#if (FEATURE_MODE == 0)
/**
 @file ctc_ipfix_cli.c

 @author  Copyright (C) 2013 Centec Networks Inc.  All rights reserved.

 @date 2013-10-24

 @version v3.0

 The file apply clis of ipfix module
*/

#include "ctc_api.h"
#include "ctcs_api.h"
#include "ctc_cli.h"
#include "ctc_cli_common.h"
#include "ctc_debug.h"
#include "ctc_ipfix_cli.h"
#include "ctc_xdata_cli.h"


#define CTC_CLI_IPFIX_SET_SUPPRESS_EXPORT_REASON_BMP do{\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("expired")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_EXPIRED);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("tcp-close")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_TCP_CLOSE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("pktcnt-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_PACKET_CNT_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("bytecnt-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_BYTE_CNT_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("ts-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_LAST_TS_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("hash-conflict")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_HASH_CONFLICT);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("new-flow")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_NEW_FLOW_INSERT);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("dest-change")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_DEST_CHANGE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("jitter-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_JITTER_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("latency-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_LATENCY_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("ttl-change")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_TTL_CHANGE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("drop-pktcnt-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_DROP_CNT_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("drop-reason-change")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_DROP_REASON_CHANGE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("tc-mark")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_TC_MARK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("dump-entry")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_DUMP);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("burst-event")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_BURST_EVENT);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("latency-event")))\
    {\
        CTC_BIT_SET(flow_cfg.suppress_reason_bmp, CTC_IPFIX_REASON_LATENCY_EVENT);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("disable")))\
    {\
        flow_cfg.suppress_reason_bmp = 0;\
    }\
}\
while(0)

#define CTC_CLI_IPFIX_SET_DENY_EXPORT_REASON_BMP do{\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("expired")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_EXPIRED);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("tcp-close")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_TCP_CLOSE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("pktcnt-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_PACKET_CNT_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("bytecnt-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_BYTE_CNT_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("ts-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_LAST_TS_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("hash-conflict")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_HASH_CONFLICT);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("new-flow")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_NEW_FLOW_INSERT);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("dest-change")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_DEST_CHANGE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("jitter-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_JITTER_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("latency-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_LATENCY_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("ttl-change")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_TTL_CHANGE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("drop-pktcnt-overflow")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_DROP_CNT_OVERFLOW);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("drop-reason-change")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_DROP_REASON_CHANGE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("tc-mark")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_TC_MARK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("dump-entry")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_DUMP);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("burst-event")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_BURST_EVENT);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("latency-event")))\
    {\
        CTC_BIT_SET(flow_cfg.deny_export_reason_bmp, CTC_IPFIX_REASON_LATENCY_EVENT);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("disable")))\
    {\
        flow_cfg.deny_export_reason_bmp = 0;\
    }\
}\
while(0)

#define CTC_CLI_IPFIX_SET_DROP_BMP do{\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("none")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_NONE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("lpbk-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_LPBK_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("parser-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_PARSER_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("excp")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_EXCP);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("transmit-dis")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_TRANSIT_DISABLE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("receive-dis")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_RECEIVE_DISABLE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("fwd-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_FWD_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("vlan-filter")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_VLAN_FILTER);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("ip-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_IP_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("stp-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_STP_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("policing")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_POLICING);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("security-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_SECURITY_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("port-mac-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_PORT_MAC_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("isolate-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_ISOLATE_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("pkt-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_PKT_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("hw-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_HW_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("stk-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_STK_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("bpe-port-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_BPE_PORT_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("ip-src-guard")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_IP_SRC_GUARD);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("lag-empty")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_LAG_EMPTY);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("aps")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_APS);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("scl-deny")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_SCL_DENY);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("acl-deny")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_ACL_DENY);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("ptp")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_PTP);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("oam")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_OAM);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("dot1ae")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_DOT1AE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("mimicry")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_MIMICRY);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("vpls")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_VPLS);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("mirror")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_MIRROR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("trill")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_TRILL);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("bfd")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_BFD);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("pon")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_PON);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("arp-or-dhcp-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_ARP_OR_DHCP_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("arp-miss")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_ARP_MISS);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("vxlan-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_VXLAN_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("tunnel-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_TUNNEL_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("icmp-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_ICMP_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("ttl-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_TTL_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("sd-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_SD_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("mpls-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_MPLS_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("mtu-chk")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_MTU_CHK);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("pld-op-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_PLD_OP_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("latency")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_LATENCY);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("edit-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_EDIT_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("chksum-err")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_CHKSUM_ERR);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("traffic-manager")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_TRAFFIC_MANAGER);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("net-tx")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_NET_TX);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("net-rx")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_NET_RX);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("queue")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_QUEUE);\
    }\
    if (INDEX_VALID(CTC_CLI_GET_ARGC_INDEX("buffer-store")))\
    {\
        CTC_BMP_SET(flow_cfg.drop_report_bmp, CTC_DROP_BS);\
    }\
}\
while(0)

int32 _ctc_cli_ipfix_parser_mpls_key(ctc_vti_t* vty, unsigned char argc,char** argv, ctc_ipfix_data_t *data)
{
    uint8 index = 0;

    index = CTC_CLI_GET_ARGC_INDEX("label-num");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("label-num", data->l3_info.mpls.label_num, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls0-label");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("label", data->l3_info.mpls.label[0].label, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls0-s");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("label", data->l3_info.mpls.label[0].sbit, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls0-exp");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("label", data->l3_info.mpls.label[0].exp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls0-ttl");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("label", data->l3_info.mpls.label[0].ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls1-label");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("label", data->l3_info.mpls.label[1].label, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls1-s");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("sbit", data->l3_info.mpls.label[1].sbit, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls1-exp");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("exp", data->l3_info.mpls.label[1].exp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls1-ttl");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ttl", data->l3_info.mpls.label[1].ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls2-label");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("label", data->l3_info.mpls.label[2].label, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls2-s");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("sbit", data->l3_info.mpls.label[2].sbit, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls2-exp");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("exp", data->l3_info.mpls.label[2].exp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls2-ttl");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ttl", data->l3_info.mpls.label[2].ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }
    return CLI_SUCCESS;
}
/********************** Field Select *******************/
#define CTC_CLI_IPFIX_HASH_FIELD_PORT_STR "(gport |logic-port |metadata)"
#define CTC_CLI_IPFIX_HASH_FIELD_CID_STR "src-cid | dst-cid"

#define CTC_CLI_IPFIX_HASH_FIELD_PORT_STR_DESC \
"Gport",\
"Logic-port",\
"Metadata"

#define CTC_CLI_IPFIX_HASH_FIELD_CID_STR_DESC \
"Source category id",\
"Dest category id"

#define CTC_CLI_IPFIX_HASH_FIELD_MAC_KEY_STR  \
    "{"CTC_CLI_IPFIX_HASH_FIELD_PORT_STR "|"CTC_CLI_IPFIX_HASH_FIELD_CID_STR \
    "|profile-id| mac-da | mac-sa | eth-type | vlan | cos | cfi | cvlan | ctag-cos | ctag-cfi | fid}"

#define CTC_CLI_IPFIX_HASH_FIELD_MAC_KEY_DESC  \
  CTC_CLI_IPFIX_HASH_FIELD_PORT_STR_DESC,\
  CTC_CLI_IPFIX_HASH_FIELD_CID_STR_DESC,\
  "Profile id",\
  CTC_CLI_MACDA_DESC,\
  CTC_CLI_MACSA_DESC,\
  CTC_CLI_ETHTYPE_DESC,\
  CTC_CLI_VLAN_DESC,\
  "Cos",\
  "CFI",\
  "Cvlan",\
  "Ctag Cos",\
  "Ctag CFI",\
  "Fid"
STATIC int32 _ctc_cli_ipfix_parser_mac_hash_field_sel(ctc_vti_t* vty,unsigned char argc,char** argv, ctc_ipfix_hash_mac_field_sel_t *mac_field)
{
    uint8 index = 0;
    uint8 start_index = 0;
    start_index = CTC_CLI_GET_ARGC_INDEX("mac-key");

    index = CTC_CLI_GET_SPECIFIC_INDEX("gport",start_index);
    if(index != 0xFF)
    {
        mac_field->gport= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("logic-port",start_index);
    if(index != 0xFF)
    {
        mac_field->logic_port= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("metadata",start_index);
    if(index != 0xFF)
    {
        mac_field->metadata= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("profile-id",start_index);
    if(index != 0xFF)
    {
        mac_field->profile_id = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("src-cid",start_index);
    if(index != 0xFF)
    {
        mac_field->src_cid = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("dst-cid",start_index);
    if(index != 0xFF)
    {
        mac_field->dst_cid = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mac-da",start_index);
    if(index != 0xFF)
    {
        mac_field->mac_da = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mac-sa",start_index);
    if(index != 0xFF)
    {
        mac_field->mac_sa = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("eth-type",start_index);
    if(index != 0xFF)
    {
        mac_field->eth_type= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("vlan",start_index);
    if(index != 0xFF)
    {
        mac_field->vlan_id= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("cfi",start_index);
    if(index != 0xFF)
    {
        mac_field->cfi= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("cos",start_index);
    if(index != 0xFF)
    {
        mac_field->cos= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("cvlan", start_index);
    if (index != 0xFF)
    {
        mac_field->ctag_vlan = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ctag-cos", start_index);
    if (index != 0xFF)
    {
        mac_field->ctag_cos = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ctag-cfi", start_index);
    if (index != 0xFF)
    {
        mac_field->ctag_cfi = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("fid", start_index);
    if (index != 0xFF)
    {
        mac_field->fid = 1;
    }
 /*    index = CTC_CLI_GET_SPECIFIC_INDEX("vni",start_index);*/
 /*    if(index != 0xFF)*/
 /*    {*/
 /*       mac_field->vni= 1;*/
 /*    }*/

 /*    index = CTC_CLI_GET_SPECIFIC_INDEX("vlan-valid",start_index);*/
 /*    if(index != 0xFF)*/
 /*    {*/
 /*       mac_field->vlan_valid = 1;*/
 /*    }*/

    return CLI_SUCCESS;
}


STATIC int32 _ctc_cli_ipfix_get_mac_hash_field_sel(ctc_vti_t* vty,unsigned char argc,char** argv,ctc_ipfix_hash_mac_field_sel_t *mac_field)
{
    ctc_cli_out("key_type : mac-key \n");

    ctc_cli_out("------------------------------------\n");
    if (mac_field->mac_da)
    {
        ctc_cli_out("mac-da \n");
    }
    if (mac_field->mac_sa)
    {
        ctc_cli_out("mac-sa \n");
    }
    if (mac_field->eth_type)
    {
        ctc_cli_out("eth-type \n");
    }
    if (mac_field->gport)
    {
        ctc_cli_out("gport \n");
    }
    if (mac_field->logic_port)
    {
        ctc_cli_out("logic-port \n");
    }
    if (mac_field->metadata)
    {
        ctc_cli_out("metadata \n");
    }
    if (mac_field->cos)
    {
        ctc_cli_out("cos \n");
    }
    if (mac_field->cfi)
    {
        ctc_cli_out("cfi \n");
    }
    if (mac_field->vlan_id)
    {
        ctc_cli_out("vlan \n");
    }
    if (mac_field->src_cid)
    {
        ctc_cli_out("src-cid \n");
    }
    if (mac_field->dst_cid)
    {
        ctc_cli_out("dst-cid \n");
    }
    if (mac_field->ctag_cos)
    {
        ctc_cli_out("ctag-cos \n");
    }
    if (mac_field->ctag_cfi)
    {
        ctc_cli_out("ctag-cfi \n");
    }
    if (mac_field->ctag_vlan)
    {
        ctc_cli_out("cvlan \n");
    }
    if (mac_field->fid)
    {
        ctc_cli_out("fid \n");
    }
    if (mac_field->profile_id)
    {
        ctc_cli_out("profile-id \n");
    }
    ctc_cli_out("------------------------------------\n");

    return CLI_SUCCESS;
}





#define CTC_CLI_IPFIX_HASH_FIELD_MPLS_STR \
    "label-num | \
     mpls0-label | mpls0-s | mpls0-exp | mpls0-ttl | \
     mpls1-label | mpls1-s | mpls1-exp | mpls1-ttl | \
     mpls2-label | mpls2-s | mpls2-exp | mpls2-ttl"

#define CTC_CLI_IPFIX_HASH_FIELD_MPLS_STR_DESC \
 "Label-num",\
 "MPLS0-label",\
 "MPLS0-s",\
 "MPLS0-exp",\
 "MPLS0-ttl",\
 "MPLS1-label",\
 "MPLS1-s",\
 "MPLS1-exp",\
 "MPLS1-ttl",\
 "MPLS2-label",\
 "MPLS2-s",\
 "MPLS2-exp",\
 "MPLS2-ttl"

#define CTC_CLI_IPFIX_HASH_FIELD_MPLS_KEY_STR \
    "{"CTC_CLI_IPFIX_HASH_FIELD_PORT_STR "|profile-id |fid|"CTC_CLI_IPFIX_HASH_FIELD_MPLS_STR"}"

#define CTC_CLI_IPFIX_HASH_FIELD_MPLS_KEY_STR_DESC \
    CTC_CLI_IPFIX_HASH_FIELD_PORT_STR_DESC,\
    "Profile id",\
    "Fid",\
    CTC_CLI_IPFIX_HASH_FIELD_MPLS_STR_DESC


STATIC int32 _ctc_cli_ipfix_parser_mpls_hash_field_sel(ctc_vti_t* vty,unsigned char argc,char** argv, ctc_ipfix_hash_mpls_field_sel_t *mpls_field)
{
    uint8 index = 0;
    uint8 start_index = 0;
    start_index = CTC_CLI_GET_ARGC_INDEX("mpls-key");

    index = CTC_CLI_GET_SPECIFIC_INDEX("gport",start_index);
    if(index != 0xFF)
       {
          mpls_field->gport= 1;
       }
    index = CTC_CLI_GET_SPECIFIC_INDEX("logic-port",start_index);
    if(index != 0xFF)
       {
          mpls_field->logic_port= 1;
       }
    index = CTC_CLI_GET_SPECIFIC_INDEX("metadata",start_index);
    if(index != 0xFF)
    {
      mpls_field->metadata= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("profile-id",start_index);
    if(index != 0xFF)
    {
        mpls_field->profile_id = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("label-num",start_index);
    if(index != 0xFF)
       {
          mpls_field->label_num= 1;
       }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls0-label",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label0_label = 1;
       }


    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls0-s",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label0_s= 1;
       }


    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls0-exp",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label0_exp= 1;
       }


    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls0-ttl",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label0_ttl = 1;
       }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls1-label",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label1_label = 1;
       }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls1-s",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label1_s= 1;
       }


    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls1-exp",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label1_exp= 1;
       }


    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls1-ttl",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label1_ttl = 1;
       }
        index = CTC_CLI_GET_SPECIFIC_INDEX("mpls2-label",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label2_label = 1;
       }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls2-s",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label2_s= 1;
       }


    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls2-exp",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label2_exp= 1;
       }


    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls2-ttl",start_index);
    if(index != 0xFF)
       {
          mpls_field->mpls_label2_ttl = 1;
       }
    index = CTC_CLI_GET_SPECIFIC_INDEX("fid",start_index);
    if(index != 0xFF)
    {
        mpls_field->fid = 1;
    }
    return CLI_SUCCESS;
}


STATIC int32 _ctc_cli_ipfix_get_mpls_hash_field_sel(ctc_vti_t* vty,unsigned char argc,char** argv, ctc_ipfix_hash_mpls_field_sel_t *mpls_field,uint8 single)
{
    if (single)
    {
        ctc_cli_out("key_type : mpls-single-key \n");
    }
    else
    {
        ctc_cli_out("key_type : mpls-key \n");	
    }

    ctc_cli_out("------------------------------------\n");
    if (mpls_field->label_num)
    {
        ctc_cli_out("label-num \n");
    }
    if (mpls_field->mpls_label0_label)
    {
        ctc_cli_out("mpls-label0-label \n");
    }
    if (mpls_field->mpls_label0_exp)
    {
        ctc_cli_out("mpls-label0-exp \n");
    }
    if (mpls_field->mpls_label0_s)
    {
        ctc_cli_out("mpls-label0-s \n");
    }
    if (mpls_field->mpls_label0_ttl)
    {
        ctc_cli_out("mpls-label0-ttl \n");
    }
    if (mpls_field->mpls_label1_label)
    {
        ctc_cli_out("mpls-label1-label \n");
    }
    if (mpls_field->mpls_label1_exp)
    {
        ctc_cli_out("mpls-label1-exp \n");
    }
    if (mpls_field->mpls_label1_s)
    {
        ctc_cli_out("mpls-label1-s \n");
    }
    if (mpls_field->mpls_label1_ttl)
    {
        ctc_cli_out("mpls-label1-ttl \n");
    }
    if (mpls_field->mpls_label2_label)
    {
        ctc_cli_out("mpls-label2-label \n");
    }
    if (mpls_field->mpls_label2_exp)
    {
        ctc_cli_out("mpls-label2-exp \n");
    }
    if (mpls_field->mpls_label2_s)
    {
        ctc_cli_out("mpls-label2-s \n");
    }
    if (mpls_field->mpls_label2_ttl)
    {
        ctc_cli_out("mpls-label2-ttl \n");
    }
    if (mpls_field->profile_id)
    {
        ctc_cli_out("profile-id \n");
    }
    if (mpls_field->logic_port)
    {
        ctc_cli_out("logic-port \n");
    }
    if (mpls_field->gport)
    {
        ctc_cli_out("gport \n");
    }
    if (mpls_field->metadata)
    {
        ctc_cli_out("metadata \n");
    }
    if (mpls_field->fid)
    {
        ctc_cli_out("fid \n");
    }
    ctc_cli_out("------------------------------------\n");

    return CLI_SUCCESS;
}


#define CTC_CLI_IPFIX_HASH_FIELD_L4_STR \
"l4-src-port | l4-dst-port | icmp-type | icmp-code | igmp-type"

#define CTC_CLI_IPFIX_HASH_FIELD_L4_STR_DESC \
"L4-src-port",\
"L4-dst-port",\
"Icmp-type ",\
"Icmp-code",\
"Igmp-type"

#define CTC_CLI_IPFIX_HASH_FIELD_IPV4_STR \
"ip-sa mask-len LEN| ip-da mask-len LEN| dscp|ttl|ecn|ip-identification|ip-frag|vrfid|tcp-flags FLAGS|fid|sym-session|" CTC_CLI_IPFIX_HASH_FIELD_L4_STR

#define CTC_CLI_IPFIX_HASH_FIELD_IPV4_STR_DESC \
"IP-sa",\
"Mask-len",\
"Mask len value<1-32>",\
"IP-da",\
"Mask-len",\
"Mask len value<1-32>",\
"DSCP",\
"TTL",\
"Ecn",\
"IP-idntificaiton",\
"IP-frag",\
"Vrfid",\
"TCP-flags",\
"TCP-flags bitmap <1-0xFF>",\
"Fid",\
"Sysmetric session",\
CTC_CLI_IPFIX_HASH_FIELD_L4_STR_DESC

#define CTC_CLI_IPFIX_HASH_FIELD_IPV4_KEY_STR \
    "{" CTC_CLI_IPFIX_HASH_FIELD_PORT_STR "|profile-id|"CTC_CLI_IPFIX_HASH_FIELD_CID_STR "|"CTC_CLI_IPFIX_HASH_FIELD_IPV4_STR\
    "|ip-pkt-len|gre-key|nvgre-key|ip-protocol|vni|l4-sub-type| }"

#define CTC_CLI_IPFIX_HASH_FIELD_IPV4_KEY_STR_DESC \
   CTC_CLI_IPFIX_HASH_FIELD_PORT_STR_DESC, \
   "Profile id",\
   CTC_CLI_IPFIX_HASH_FIELD_CID_STR_DESC,\
   CTC_CLI_IPFIX_HASH_FIELD_IPV4_STR_DESC,\
   "IP-pkt-len",\
   "GRE-key",\
   "NVGRE-key",\
   "IP-protocol",\
   "Vxlan-vni",\
   "L4-sub-type"

STATIC int32 _ctc_cli_ipfix_parser_ipv4_hash_field_sel(ctc_vti_t* vty, unsigned char argc,char** argv, ctc_ipfix_hash_ipv4_field_sel_t *ipv4_field)
{
    uint8 index = 0;
    uint8 mask_len = 0;
    uint8 start_index = 0;
    start_index = CTC_CLI_GET_ARGC_INDEX("ipv4-key");

    index = CTC_CLI_GET_SPECIFIC_INDEX("gport",start_index);
    if(index != 0xFF)
    {
        ipv4_field->gport= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("logic-port",start_index);
    if(index != 0xFF)
    {
        ipv4_field->logic_port= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("metadata",start_index);
    if(index != 0xFF)
    {
        ipv4_field->metadata= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("profile-id",start_index);
    if(index != 0xFF)
    {
        ipv4_field->profile_id = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("src-cid",start_index);
    if(index != 0xFF)
    {
        ipv4_field->src_cid = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("dst-cid",start_index);
    if(index != 0xFF)
    {
        ipv4_field->dst_cid = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-da",start_index);
    if(index != 0xFF)
    {
        ipv4_field->ip_da= 1;
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[start_index+index+2],0, CTC_MAX_UINT8_VALUE);
        ipv4_field->ip_da_mask = mask_len;

    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-sa",start_index);
    if(index != 0xFF)
    {
        ipv4_field->ip_sa = 1;
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[start_index+index+2],0, CTC_MAX_UINT8_VALUE);
        ipv4_field->ip_sa_mask = mask_len;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("dscp",start_index);
    if(index != 0xFF)
    {
        ipv4_field->dscp = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ttl",start_index);
    if(index != 0xFF)
    {
        ipv4_field->ttl = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ecn",start_index);
    if(index != 0xFF)
    {
        ipv4_field->ecn = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-src-port",start_index);
    if(index != 0xFF)
    {
        ipv4_field->l4_src_port= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-dst-port",start_index);
    if(index != 0xFF)
    {
        ipv4_field->l4_dst_port= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-identification",start_index);
    if(index != 0xFF)
    {
        ipv4_field->ip_identification = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-pkt-len",start_index);
    if(index != 0xFF)
    {
        ipv4_field->ip_pkt_len= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-frag",start_index);
    if(index != 0xFF)
    {
        ipv4_field->ip_frag= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("tcp-flags",start_index);
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("tcp-flags", ipv4_field->tcp_flags, argv[index+start_index+1]);
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("vrfid",start_index);
    if(index != 0xFF)
    {
        ipv4_field->vrfid= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("icmp-type",start_index);
    if(index != 0xFF)
    {
        ipv4_field->icmp_type= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("icmp-code",start_index);
    if(index != 0xFF)
    {
        ipv4_field->icmp_code= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("igmp-type",start_index);
    if(index != 0xFF)
    {
        ipv4_field->igmp_type= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("gre-key",start_index);
    if(index != 0xFF)
    {
        ipv4_field->gre_key= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("nvgre-key",start_index);
    if(index != 0xFF)
    {
        ipv4_field->nvgre_key= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-protocol",start_index);
    if(index != 0xFF)
    {
        ipv4_field->ip_protocol= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-sub-type",start_index);
    if(index != 0xFF)
    {
        ipv4_field->l4_sub_type = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("vni",start_index);
    if(index != 0xFF)
    {
        ipv4_field->vxlan_vni= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("fid",start_index);
    if(index != 0xFF)
    {
        ipv4_field->fid = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("sym-session",start_index);
    if(index != 0xFF)
    {
        ipv4_field->sym_session_en = 1;
    }
    return CLI_SUCCESS;
}

STATIC int32 _ctc_cli_ipfix_get_ipv4_hash_field_sel(ctc_vti_t* vty,unsigned char argc,char** argv,ctc_ipfix_hash_ipv4_field_sel_t *ipv4_field,uint8 single)
{
    if (single)
    {
        ctc_cli_out("key_type : ipv4-single-key \n");
    }
    else
    {
        ctc_cli_out("key_type : ipv4-key \n");	
    }

    ctc_cli_out("------------------------------------\n");
    if (ipv4_field->ip_da)
    {
        ctc_cli_out("ip-da \n");
    }
    if (ipv4_field->ip_sa)
    {
        ctc_cli_out("ip-sa \n");
    }
    if (ipv4_field->ip_protocol)
    {
        ctc_cli_out("ip-protocol \n");
    }
    if (ipv4_field->l4_src_port)
    {
        ctc_cli_out("l4-src-port \n");
    }
    if (ipv4_field->l4_dst_port)
    {
        ctc_cli_out("l4-dst-port \n");
    }
    if (ipv4_field->icmp_type)
    {
        ctc_cli_out("icmp-type \n");
    }
    if (ipv4_field->icmp_code)
    {
        ctc_cli_out("icmp-code \n");
    }
    if (ipv4_field->igmp_type)
    {
        ctc_cli_out("igmp-type \n");
    }
    if (ipv4_field->sym_session_en)
    {
        ctc_cli_out("sym-session-en \n");
    }
    if (ipv4_field->profile_id)
    {
        ctc_cli_out("profile-id \n");
    }
    if (ipv4_field->logic_port)
    {
        ctc_cli_out("logic-port \n");
    }
    if (ipv4_field->gport)
    {
        ctc_cli_out("gport \n");
    }
    if (ipv4_field->metadata)
    {
        ctc_cli_out("metadata \n");
    }
    if (ipv4_field->dscp)
    {
        ctc_cli_out("dscp \n");
    }
    if (ipv4_field->ttl)
    {
        ctc_cli_out("ttl \n");
    }
    if (ipv4_field->ecn)
    {
        ctc_cli_out("ecn \n");
    }
    if (ipv4_field->l4_sub_type)
    {
        ctc_cli_out("l4-sub-type \n");
    }
    if (ipv4_field->ip_identification)
    {
        ctc_cli_out("ip-identification \n");
    }
    if (ipv4_field->ip_pkt_len)
    {
        ctc_cli_out("ip-pkt-len \n");
    }
    if (ipv4_field->ip_frag)
    {
        ctc_cli_out("ip-frag \n");
    }
    if (ipv4_field->tcp_flags)
    {
        ctc_cli_out("tcp-flags \n");
    }
    if (ipv4_field->vrfid)
    {
        ctc_cli_out("vrfid \n");
    }
    if (ipv4_field->fid)
    {
        ctc_cli_out("fid \n");
    }
    if (ipv4_field->vxlan_vni)
    {
        ctc_cli_out("vxlan-vni \n");
    }
    if (ipv4_field->gre_key)
    {
        ctc_cli_out("gre-key \n");
    }
    if (ipv4_field->nvgre_key)
    {
        ctc_cli_out("nvgre-key \n");
    }
    if (ipv4_field->src_cid)
    {
        ctc_cli_out("src-cid \n");
    }
    if (ipv4_field->dst_cid)
    {
        ctc_cli_out("dst-cid \n");
    }
    ctc_cli_out("------------------------------------\n");

    return CLI_SUCCESS;
}


#define CTC_CLI_IPFIX_HASH_FIELD_IPV6_KEY_STR \
"{" CTC_CLI_IPFIX_HASH_FIELD_PORT_STR "|profile-id|"CTC_CLI_IPFIX_HASH_FIELD_CID_STR\
"|ip-sa mask-len LEN|ip-da mask-len LEN |l4-type|l4-sub-type|flow-label|dscp|ttl|ecn|gre-key |nvgre-key |vni|\
wlan-radio-id|wlan-radio-mac|wlan-ctl-pkt|aware-tunnel-info-en|ip-protocol|ip-frag|tcp-flags FLAGS|fid|sym-session|ipv6-low-en|vrfid|"\
CTC_CLI_IPFIX_HASH_FIELD_L4_STR " }"

#define CTC_CLI_IPFIX_HASH_FIELD_IPV6_KEY_STR_DESC \
    CTC_CLI_IPFIX_HASH_FIELD_PORT_STR_DESC,\
    "Profile id",\
    CTC_CLI_IPFIX_HASH_FIELD_CID_STR_DESC,\
    "IP-sa",\
    "Mask-len",\
    "Mask len value<4,8,12,...,128>",\
    "IP-da",\
    "Mask-len",\
    "Mask len value<4,8,12,...,128>",\
    "L4-type",\
    "L4-sub-type",\
    "Flow-label",\
    "DSCP",\
    "TTL",\
    "Ecn",\
    "GRE-key",\
    "NVGRE-key",\
    "Vxlan-vni",\
    "Wlan-radio-id",\
    "Wlan-radio-mac",\
    "Wlan-ctl-pkt",\
    "Aware-tunnel-info-en",\
    "IP-protocol",\
    "IP-frag",\
    "Tcp-flags",\
    "Tcp-flags bitmap <1-0xFF>",\
    "Fid",\
    "Sysmetric session",\
    "Ip sel low en",\
    "Vrfid",\
    CTC_CLI_IPFIX_HASH_FIELD_L4_STR_DESC

STATIC int32 _ctc_cli_ipfix_parser_ipv6_hash_field_sel(ctc_vti_t* vty, unsigned char argc,char** argv, ctc_ipfix_hash_ipv6_field_sel_t *ipv6_field)
{
    uint8 index = 0;
    uint8 start_index = 0;
    uint8 mask_len = 0;

    start_index = CTC_CLI_GET_ARGC_INDEX("ipv6-key");

    index = CTC_CLI_GET_SPECIFIC_INDEX("ttl",start_index);
    if(index != 0xFF)
    {
        ipv6_field->ttl = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ecn",start_index);
    if(index != 0xFF)
    {
        ipv6_field->ecn= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-frag",start_index);
    if(index != 0xFF)
    {
        ipv6_field->ip_frag = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("tcp-flags",start_index);
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("tcp-flags", ipv6_field->tcp_flags, argv[index+start_index+1]);
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("gport",start_index);
    if(index != 0xFF)
    {
        ipv6_field->gport= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("logic-port",start_index);
    if(index != 0xFF)
    {
        ipv6_field->logic_port= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("metadata",start_index);
    if(index != 0xFF)
    {
        ipv6_field->metadata= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("profile-id",start_index);
    if(index != 0xFF)
    {
        ipv6_field->profile_id = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("src-cid",start_index);
    if(index != 0xFF)
    {
        ipv6_field->src_cid = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("dst-cid",start_index);
    if(index != 0xFF)
    {
        ipv6_field->dst_cid = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-da",start_index);
    if(index != 0xFF)
    {
        ipv6_field->ip_da= 1;
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[start_index+index+2],0, CTC_MAX_UINT8_VALUE);

        ipv6_field->ip_da_mask = mask_len;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-sa",start_index);
    if(index != 0xFF)
    {
        ipv6_field->ip_sa = 1;
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[start_index+index+2],0, CTC_MAX_UINT8_VALUE);

        ipv6_field->ip_sa_mask = mask_len;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("dscp",start_index);
    if(index != 0xFF)
    {
        ipv6_field->dscp = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("gre-key",start_index);
    if(index != 0xFF)
    {
        ipv6_field->gre_key = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("nvgre-key",start_index);
    if(index != 0xFF)
    {
        ipv6_field->nvgre_key = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("vni",start_index);
    if(index != 0xFF)
    {
        ipv6_field->vxlan_vni= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("wlan-radio-id",start_index);
    if(index != 0xFF)
    {
        ipv6_field->wlan_radio_id = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("wlan-radio-mac",start_index);
    if(index != 0xFF)
    {
        ipv6_field->wlan_radio_mac = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("wlan-ctl-pkt",start_index);
    if(index != 0xFF)
    {
        ipv6_field->wlan_ctl_packet = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("aware-tunnel-info-en",start_index);
    if(index != 0xFF)
    {
        ipv6_field->aware_tunnel_info_en= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-protocol",start_index);
    if(index != 0xFF)
    {
        ipv6_field->ip_protocol = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("flow-label",start_index);
    if(index != 0xFF)
    {
        ipv6_field->flow_label= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-dst-port",start_index);
    if(index != 0xFF)
    {
        ipv6_field->l4_dst_port= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-src-port",start_index);
    if(index != 0xFF)
    {
        ipv6_field->l4_src_port= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("icmp-type",start_index);
    if(index != 0xFF)
    {
        ipv6_field->icmp_type= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("icmp-code",start_index);
    if(index != 0xFF)
    {
        ipv6_field->icmp_code= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("igmp-type",start_index);
    if(index != 0xFF)
    {
        ipv6_field->igmp_type = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-type",start_index);
    if(index != 0xFF)
    {
        ipv6_field->l4_type = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-sub-type",start_index);
    if(index != 0xFF)
    {
        ipv6_field->l4_sub_type = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("fid",start_index);
    if(index != 0xFF)
    {
        ipv6_field->fid = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("sym-session",start_index);
    if(index != 0xFF)
    {
        ipv6_field->sym_session_en = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ipv6-low-en",start_index);
    if(index != 0xFF)
    {
        ipv6_field->ipv6_low_en = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("vrfid",start_index);
    if(index != 0xFF)
    {
        ipv6_field->vrfid = 1;
    }
    return CLI_SUCCESS;
}


STATIC int32 _ctc_cli_ipfix_get_ipv6_hash_field_sel(ctc_vti_t* vty, unsigned char argc,char** argv, ctc_ipfix_hash_ipv6_field_sel_t *ipv6_field,uint8 single)
{
    if (single)
    {
        ctc_cli_out("key_type : ipv6-single-key \n");
    }
    else
    {
        ctc_cli_out("key_type : ipv6-key \n");	
    }
    ctc_cli_out("------------------------------------\n");

    if (ipv6_field->ip_da)
    {
        ctc_cli_out("ip-da \n");
    }
    if (ipv6_field->ip_sa)
    {
        ctc_cli_out("ip-sa \n");
    }
    if (ipv6_field->ip_protocol)
    {
        ctc_cli_out("ip-protocol \n");
    }
    if (ipv6_field->l4_src_port)
    {
        ctc_cli_out("l4-src-port \n");
    }
    if (ipv6_field->l4_dst_port)
    {
        ctc_cli_out("l4-dst-port \n");
    }
    if (ipv6_field->icmp_type)
    {
        ctc_cli_out("icmp-type \n");
    }
    if (ipv6_field->icmp_code)
    {
        ctc_cli_out("icmp-code \n");
    }
    if (ipv6_field->igmp_type)
    {
        ctc_cli_out("igmp-type \n");
    }
    if (ipv6_field->sym_session_en)
    {
        ctc_cli_out("sym-session-en \n");
    }
    if (ipv6_field->profile_id)
    {
        ctc_cli_out("profile-id \n");
    }
    if (ipv6_field->ipv6_low_en)
    {
        ctc_cli_out("ipv6-low-en \n");
    }
    if (ipv6_field->vrfid)
    {
        ctc_cli_out("vrfid \n");
    }
    if (ipv6_field->gport)
    {
        ctc_cli_out("gport \n");
    }
    if (ipv6_field->logic_port)
    {
        ctc_cli_out("logic-port \n");
    }
    if (ipv6_field->metadata)
    {
        ctc_cli_out("metadata \n");
    }
    if (ipv6_field->dscp)
    {
        ctc_cli_out("dscp \n");
    }
    if (ipv6_field->ttl)
    {
        ctc_cli_out("ttl \n");
    }
    if (ipv6_field->ecn)
    {
        ctc_cli_out("ecn \n");
    }
    if (ipv6_field->flow_label)
    {
        ctc_cli_out("flow-label \n");
    }
    if (ipv6_field->l4_type)
    {
        ctc_cli_out("l4-type \n");
    }
    if (ipv6_field->l4_sub_type)
    {
        ctc_cli_out("l4-sub-type \n");
    }
    if (ipv6_field->fid)
    {
        ctc_cli_out("fid \n");
    }
    if (ipv6_field->vxlan_vni)
    {
        ctc_cli_out("vxlan-vni \n");
    }
    if (ipv6_field->gre_key)
    {
        ctc_cli_out("gre-key \n");
    }
    if (ipv6_field->nvgre_key)
    {
        ctc_cli_out("nvgre-key \n");
    }
    if (ipv6_field->aware_tunnel_info_en)
    {
        ctc_cli_out("aware-tunnel-info-en \n");
    }
    if (ipv6_field->wlan_radio_mac)
    {
        ctc_cli_out("wlan-radio-mac \n");
    }
    if (ipv6_field->wlan_radio_id)
    {
        ctc_cli_out("wlan-radio-id \n");
    }
    if (ipv6_field->wlan_ctl_packet)
    {
        ctc_cli_out("wlan-ctl-packet \n");
    }
    if (ipv6_field->ip_frag)
    {
        ctc_cli_out("ip-frag \n");
    }
    if (ipv6_field->tcp_flags)
    {
        ctc_cli_out("tcp-flags \n");
    }
    if (ipv6_field->src_cid)
    {
        ctc_cli_out("src-cid \n");
    }
    if (ipv6_field->dst_cid)
    {
        ctc_cli_out("dst-cid \n");
    }
    ctc_cli_out("------------------------------------\n");

    return CLI_SUCCESS;

}


#define CTC_CLI_IPFIX_HASH_FIELD_L2_L3_KEY_STR \
    "{"CTC_CLI_IPFIX_HASH_FIELD_PORT_STR "|profile-id|"CTC_CLI_IPFIX_HASH_FIELD_CID_STR"|mac-da | mac-sa |eth-type | cvlan | ctag-cos | ctag-cfi |" \
    "svlan | stag-cos | stag-cfi | ip-protocol|l4-type|l4-sub-type|" \
    CTC_CLI_IPFIX_HASH_FIELD_IPV4_STR " |gre-key|nvgre-key|vni|wlan-radio-id|wlan-radio-mac|wlan-ctl-pkt|aware-tunnel-info-en|" \
    CTC_CLI_IPFIX_HASH_FIELD_MPLS_STR "| arp-op-code | arp-sender-mac | arp-target-mac |arp-sender-ip | arp-target-ip""}"


#define CTC_CLI_IPFIX_HASH_FIELD_L2_L3_KEY_STR_DESC \
    CTC_CLI_IPFIX_HASH_FIELD_PORT_STR_DESC,\
    "Profile id",\
    CTC_CLI_IPFIX_HASH_FIELD_CID_STR_DESC,\
    CTC_CLI_MACDA_DESC,\
    CTC_CLI_MACSA_DESC,\
    "Eth-type",\
    "Ctag-vlan",\
    "Cvlan",\
    "Ctag-cfi",\
    "Svlan",\
    "Stag-cos",\
    "Stag-cfi",\
    "IP protocol",\
    "L4-type",\
    "L4-sub-type",\
    CTC_CLI_IPFIX_HASH_FIELD_IPV4_STR_DESC,\
    "GRE-key",\
    "NVGRE-key",\
    "Vxlan-vni",\
    "Wlan-radio-id",\
    "Wlan-radio-mac",\
    "Wlan-ctl-pkt",\
    "Aware-tunnel-info-en",\
    CTC_CLI_IPFIX_HASH_FIELD_MPLS_STR_DESC,\
    "Arp op code",\
    "Arp sender mac",\
    "Arp target mac",\
	"Arp sender ip",\
	"Arp target ip"	  

STATIC int32 _ctc_cli_ipfix_parser_l2l3_hash_field_sel(ctc_vti_t* vty, uint8 argc,char** argv, ctc_ipfix_hash_l2_l3_field_sel_t *merge_field)
{
    uint8 index = 0;
    uint8 mask_len = 0;
    uint8 start_index = 0;
    start_index = CTC_CLI_GET_ARGC_INDEX("l2l3-key");

    index = CTC_CLI_GET_SPECIFIC_INDEX("gport",start_index);
    if(index != 0xFF)
    {
        merge_field->gport= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("logic-port",start_index);
    if(index != 0xFF)
    {
        merge_field->logic_port= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("metadata",start_index);
    if(index != 0xFF)
    {
        merge_field->metadata= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("profile-id",start_index);
    if(index != 0xFF)
    {
        merge_field->profile_id = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mac-da",start_index);
    if(index != 0xFF)
    {
        merge_field->mac_da = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mac-sa",start_index);
    if(index != 0xFF)
    {
        merge_field->mac_sa = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("eth-type",start_index);
    if(index != 0xFF)
    {
        merge_field->eth_type= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("src-cid",start_index);
    if(index != 0xFF)
    {
        merge_field->src_cid = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("dst-cid",start_index);
    if(index != 0xFF)
    {
        merge_field->dst_cid = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("cvlan",start_index);
    if(index != 0xFF)
    {
        merge_field->ctag_vlan= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ctag-cfi",start_index);
    if(index != 0xFF)
    {
        merge_field->ctag_cfi= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ctag-cos",start_index);
    if(index != 0xFF)
    {
        merge_field->ctag_cos= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("svlan",start_index);
    if(index != 0xFF)
    {
        merge_field->stag_vlan= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("stag-cfi",start_index);
    if(index != 0xFF)
    {
        merge_field->stag_cfi= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("stag-cos",start_index);
    if(index != 0xFF)
    {
        merge_field->stag_cos= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-type",start_index);
    if(index != 0xFF)
    {
        merge_field->l4_type= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-sub-type",start_index);
    if(index != 0xFF)
    {
        merge_field->l4_sub_type = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-da",start_index);
    if(index != 0xFF)
    {
        merge_field->ip_da= 1;

        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[start_index+index+2],0, CTC_MAX_UINT8_VALUE);
        merge_field->ip_da_mask = mask_len;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-sa",start_index);
    if(index != 0xFF)
    {
        merge_field->ip_sa = 1;
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[start_index+index+2],0, CTC_MAX_UINT8_VALUE);
        merge_field->ip_sa_mask = mask_len;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("dscp",start_index);
    if(index != 0xFF)
    {
        merge_field->dscp = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-src-port",start_index);
    if(index != 0xFF)
    {
        merge_field->l4_src_port= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("l4-dst-port",start_index);
    if(index != 0xFF)
    {
        merge_field->l4_dst_port= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("icmp-type",start_index);
    if(index != 0xFF)
    {
        merge_field->icmp_type= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("icmp-code",start_index);
    if(index != 0xFF)
    {
        merge_field->icmp_code= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("igmp-type",start_index);
    if(index != 0xFF)
    {
        merge_field->igmp_type = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ecn",start_index);
    if(index != 0xFF)
    {
        merge_field->ecn= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("gre-key",start_index);
    if(index != 0xFF)
    {
        merge_field->gre_key= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("nvgre-key",start_index);
    if(index != 0xFF)
    {
        merge_field->nvgre_key= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("vni",start_index);
    if(index != 0xFF)
    {
        merge_field->vxlan_vni= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("wlan-radio-id",start_index);
    if(index != 0xFF)
    {
        merge_field->wlan_radio_id = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("wlan-radio-mac",start_index);
    if(index != 0xFF)
    {
        merge_field->wlan_radio_mac = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("wlan-ctl-pkt",start_index);
    if(index != 0xFF)
    {
        merge_field->wlan_ctl_packet = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("aware-tunnel-info-en",start_index);
    if(index != 0xFF)
    {
        merge_field->aware_tunnel_info_en = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ttl",start_index);
    if(index != 0xFF)
    {
        merge_field->ttl= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-identification",start_index);
    if(index != 0xFF)
    {
        merge_field->ip_identification = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-protocol",start_index);
    if(index != 0xFF)
    {
        merge_field->ip_protocol = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("tcp-flags",start_index);
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("tcp-flags", merge_field->tcp_flags, argv[index+start_index+1]);
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("ip-frag",start_index);
    if(index != 0xFF)
    {
        merge_field->ip_frag = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("vrfid",start_index);
    if(index != 0xFF)
    {
        merge_field->vrfid = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("label-num",start_index);
    if(index != 0xFF)
    {
        merge_field->label_num= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls0-label",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label0_label = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls0-s",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label0_s= 1;
    }


    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls0-exp",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label0_exp= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls0-ttl",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label0_ttl = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls1-label",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label1_label = 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls1-s",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label1_s= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls1-exp",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label1_exp= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls1-ttl",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label1_ttl = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls2-label",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label2_label = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls2-s",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label2_s= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls2-exp",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label2_exp= 1;
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("mpls2-ttl",start_index);
    if(index != 0xFF)
    {
        merge_field->mpls_label2_ttl = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("fid",start_index);
    if(index != 0xFF)
    {
        merge_field->fid = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("sym-session",start_index);
    if(index != 0xFF)
    {
        merge_field->sym_session_en = 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("arp-op-code",start_index);
    if(index != 0xFF)
    {
        merge_field->arp_code = 1;
    } 
	index = CTC_CLI_GET_SPECIFIC_INDEX("arp-sender-mac",start_index);
    if(index != 0xFF)
    {
        merge_field->arp_mac_sa = 1;
    }
	index = CTC_CLI_GET_SPECIFIC_INDEX("arp-target-mac",start_index);
    if(index != 0xFF)
    {
        merge_field->arp_mac_da = 1;
    }
	index = CTC_CLI_GET_SPECIFIC_INDEX("arp-sender-ip",start_index);
    if(index != 0xFF)
    {
        merge_field->ip_sa= 1;
        merge_field->ip_sa_mask = 32;
    }
	index = CTC_CLI_GET_SPECIFIC_INDEX("arp-target-ip",start_index);
    if(index != 0xFF)
    {
        merge_field->ip_da = 1;
        merge_field->ip_da_mask = 32;
    }
    return CLI_SUCCESS;
}


	
STATIC int32 _ctc_cli_ipfix_get_l2l3_hash_field_sel(ctc_vti_t* vty, uint8 argc,char** argv, ctc_ipfix_hash_l2_l3_field_sel_t *merge_field)
{
    ctc_cli_out("key_type : l2l3-key \n");
    ctc_cli_out("------------------------------------\n");

    if (merge_field->gport)
    {
        ctc_cli_out("gport \n");
    }
    if (merge_field->logic_port)
    {
        ctc_cli_out("logic-port \n");
    }
    if (merge_field->metadata)
    {
        ctc_cli_out("metadata \n");
    }
    if (merge_field->mac_da)
    {
        ctc_cli_out("mac-da \n");
    }
    if (merge_field->mac_sa)
    {
        ctc_cli_out("mac-sa \n");
    }
    if (merge_field->stag_cos)
    {
        ctc_cli_out("stag-cos \n");
    }
    if (merge_field->stag_cfi)
    {
        ctc_cli_out("stag-cfi \n");
    }
    if (merge_field->stag_vlan)
    {
        ctc_cli_out("stag-vlan \n");
    }
    if (merge_field->ctag_cos)
    {
        ctc_cli_out("ctag-cos \n");
    }
    if (merge_field->ctag_cfi)
    {
        ctc_cli_out("ctag-cfi \n");
    }
    if (merge_field->ctag_vlan)
    {
        ctc_cli_out("ctag-vlan \n");
    }
    if (merge_field->ip_da)
    {
        ctc_cli_out("ip-da \n");
    }
    if (merge_field->ip_sa)
    {
        ctc_cli_out("ip-sa \n");
    }
    if (merge_field->dscp)
    {
        ctc_cli_out("dscp \n");
    }
    if (merge_field->ecn)
    {
        ctc_cli_out("ecn \n");
    }
    if (merge_field->ttl)
    {
        ctc_cli_out("ttl \n");
    }
    if (merge_field->eth_type)
    {
        ctc_cli_out("eth-type \n");
    }
    if (merge_field->vrfid)
    {
        ctc_cli_out("vrfid \n");
    }
    if (merge_field->l4_type)
    {
        ctc_cli_out("l4-type \n");
    }
    if (merge_field->l4_sub_type)
    {
        ctc_cli_out("l4-sub-type \n");
    }
    if (merge_field->ip_protocol)
    {
        ctc_cli_out("ip-protocol \n");
    }
    if (merge_field->ip_identification)
    {
        ctc_cli_out("ip-identification \n");
    }
    if (merge_field->ip_frag)
    {
        ctc_cli_out("ip-frag \n");
    }
    if (merge_field->tcp_flags)
    {
        ctc_cli_out("tcp-flags \n");
    }
    if (merge_field->sym_session_en)
    {
        ctc_cli_out("sym-session-en \n");
    }
    if (merge_field->fid)
    {
        ctc_cli_out("fid \n");
    }
    if (merge_field->gre_key)
    {
        ctc_cli_out("gre-key \n");
    }
    if (merge_field->nvgre_key)
    {
        ctc_cli_out("nvgre-key \n");
    }
    if (merge_field->vxlan_vni)
    {
        ctc_cli_out("vxlan-vni \n");
    }
    if (merge_field->aware_tunnel_info_en)
    {
        ctc_cli_out("aware-tunnel-info-en \n");
    }
    if (merge_field->wlan_radio_mac)
    {
        ctc_cli_out("wlan-radio-mac \n");
    }
    if (merge_field->wlan_radio_id)
    {
        ctc_cli_out("wlan-radio-id \n");
    }
    if (merge_field->wlan_ctl_packet)
    {
        ctc_cli_out("wlan-ctl-packet \n");
    }
    if (merge_field->l4_src_port)
    {
        ctc_cli_out("l4-src-port \n");
    }
    if (merge_field->l4_dst_port)
    {
        ctc_cli_out("l4-dst-port \n");
    }
    if (merge_field->icmp_type)
    {
        ctc_cli_out("icmp-type \n");
    }
    if (merge_field->icmp_code)
    {
        ctc_cli_out("icmp-code \n");
    }
    if (merge_field->igmp_type)
    {
        ctc_cli_out("igmp-type \n");
    }
    if (merge_field->label_num)
    {
        ctc_cli_out("label-num \n");
    }
    if (merge_field->mpls_label0_label)
    {
        ctc_cli_out("mpls-label0-label \n");
    }
    if (merge_field->mpls_label0_exp)
    {
        ctc_cli_out("mpls-label0-exp \n");
    }
    if (merge_field->mpls_label0_s)
    {
        ctc_cli_out("mpls-label0-s \n");
    }
    if (merge_field->mpls_label0_ttl)
    {
        ctc_cli_out("mpls-label0-ttl \n");
    }
    if (merge_field->mpls_label1_label)
    {
        ctc_cli_out("mpls-label1-label \n");
    }
    if (merge_field->mpls_label1_exp)
    {
        ctc_cli_out("mpls-label1-exp \n");
    }
    if (merge_field->mpls_label1_s)
    {
        ctc_cli_out("mpls-label1-s \n");
    }
    if (merge_field->mpls_label1_ttl)
    {
        ctc_cli_out("mpls-label1-ttl \n");
    }
    if (merge_field->mpls_label2_label)
    {
        ctc_cli_out("mpls-label2-label \n");
    }
    if (merge_field->mpls_label2_exp)
    {
        ctc_cli_out("mpls-label2-exp \n");
    }
    if (merge_field->mpls_label2_s)
    {
        ctc_cli_out("mpls-label2-s \n");
    }
    if (merge_field->mpls_label2_ttl)
    {
        ctc_cli_out("mpls-label2-ttl \n");
    }
    if (merge_field->src_cid)
    {
        ctc_cli_out("src-cid \n");
    }
    if (merge_field->dst_cid)
    {
        ctc_cli_out("dst-cid \n");
    }
    if (merge_field->profile_id)
    {
        ctc_cli_out("profile-id \n");
    }
    if (merge_field->arp_code)
    {
        ctc_cli_out("arp-code \n");
    }
    if (merge_field->arp_mac_sa)
    {
        ctc_cli_out("arp-mac-sa \n");
    }
    if (merge_field->arp_mac_da)
    {
        ctc_cli_out("arp-mac-da \n");
    }
    ctc_cli_out("------------------------------------\n");

    return CLI_SUCCESS;
}

#define CTC_CLI_IPFIX_HASH_FIELD_UDF_KEY_STR \
    "{udf-valid VALUE |udf-data VALUE|profile-id|"CTC_CLI_IPFIX_HASH_FIELD_PORT_STR"}"

#define CTC_CLI_IPFIX_HASH_FIELD_UDF_KEY_STR_DESC \
    "UDF valid",\
    "UDF valid Value",\
    "UDF data",\
    "UDF data Value",\
    "Profile id",\
    CTC_CLI_IPFIX_HASH_FIELD_PORT_STR_DESC

STATIC int32 _ctc_cli_ipfix_parser_udf_hash_field_sel(ctc_vti_t* vty,unsigned char argc,char** argv, ctc_ipfix_hash_udf_field_sel_t *udf_field, uint8 is_short)
{
    uint8 index = 0;
    uint8 start_index = 0;

    start_index = CTC_CLI_GET_ARGC_INDEX("udf-key");

    index = CTC_CLI_GET_ARGC_INDEX("udf-valid");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT16("udf-valid", udf_field->udf_valid, argv[index+1]);
    }

    index = CTC_CLI_GET_SPECIFIC_INDEX("udf-data",start_index);
    if(index != 0xFF)
    {
        uint32 data_num = 0;
        data_num = sal_sscanf(argv[start_index+index+1], "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx",
            (uint8*)udf_field->udf_data,(uint8*)udf_field->udf_data+1,(uint8*)udf_field->udf_data+2,(uint8*)udf_field->udf_data+3,
            (uint8*)udf_field->udf_data+4,(uint8*)udf_field->udf_data+5,(uint8*)udf_field->udf_data+6,(uint8*)udf_field->udf_data+7,
            (uint8*)udf_field->udf_data+8,(uint8*)udf_field->udf_data+9,(uint8*)udf_field->udf_data+10,(uint8*)udf_field->udf_data+11,
            (uint8*)udf_field->udf_data+12,(uint8*)udf_field->udf_data+13,(uint8*)udf_field->udf_data+14,(uint8*)udf_field->udf_data+15);
        if (data_num<16)
        {
            ctc_cli_out("  %%  Get udf data fail! \n");
            return CLI_ERROR;
        }
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("gport",start_index);
    if(index != 0xFF)
    {
        udf_field->gport= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("logic-port",start_index);
    if(index != 0xFF)
    {
        udf_field->logic_port= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("metadata",start_index);
    if(index != 0xFF)
    {
        udf_field->metadata= 1;
    }
    index = CTC_CLI_GET_SPECIFIC_INDEX("profile-id",start_index);
    if(index != 0xFF)
    {
        udf_field->profile_id = 1;
    }
    return CLI_SUCCESS;
}


STATIC int32 _ctc_cli_ipfix_get_udf_hash_field_sel(ctc_vti_t* vty,unsigned char argc,char** argv, ctc_ipfix_hash_udf_field_sel_t *udf_field, uint8 single)
{
    if (single)
    {
        ctc_cli_out("key_type : udf-single-key \n");
    }
    else
    {
        ctc_cli_out("key_type : udf-key \n");	
    }

    ctc_cli_out("------------------------------------\n");
    if (udf_field->udf_valid)
    {
        ctc_cli_out("udf \n");
    }
    if (udf_field->profile_id)
    {
        ctc_cli_out("profile-id \n");
    }
    if (udf_field->logic_port)
    {
        ctc_cli_out("logic-port \n");
    }
    if (udf_field->gport)
    {
        ctc_cli_out("gport \n");
    }
    if (udf_field->metadata)
    {
        ctc_cli_out("metadata \n");
    }
    ctc_cli_out("------------------------------------\n");

    return CLI_SUCCESS;
}

#define CTC_CLI_IPFIX_HASH_FIELD_KEY_STR  \
    "(mac-key" CTC_CLI_IPFIX_HASH_FIELD_MAC_KEY_STR \
    "|ipv4-key (single|)" CTC_CLI_IPFIX_HASH_FIELD_IPV4_KEY_STR \
    "|ipv6-key (single|)" CTC_CLI_IPFIX_HASH_FIELD_IPV6_KEY_STR \
    "|mpls-key (single|)" CTC_CLI_IPFIX_HASH_FIELD_MPLS_KEY_STR \
    "|l2l3-key" CTC_CLI_IPFIX_HASH_FIELD_L2_L3_KEY_STR \
    "|udf-key (single|)" CTC_CLI_IPFIX_HASH_FIELD_UDF_KEY_STR")"

#define CTC_CLI_IPFIX_HASH_FIELD_KEY_STR_DESC  \
    "Mac-key", CTC_CLI_IPFIX_HASH_FIELD_MAC_KEY_DESC,\
    "IPv4-key","Single-key", CTC_CLI_IPFIX_HASH_FIELD_IPV4_KEY_STR_DESC,\
    "IPv6-key", "Single-key",CTC_CLI_IPFIX_HASH_FIELD_IPV6_KEY_STR_DESC,\
    "MPLS-key", "Single-key",CTC_CLI_IPFIX_HASH_FIELD_MPLS_KEY_STR_DESC,\
    "L2l3-key", CTC_CLI_IPFIX_HASH_FIELD_L2_L3_KEY_STR_DESC,\
    "UDF-key","Single-key", CTC_CLI_IPFIX_HASH_FIELD_UDF_KEY_STR_DESC
    
#define MAX_XKEY_FIELD_NUM 8

#if 0
STATIC int32 _ctc_cli_usw_ipfix_parser_mpls_key(unsigned char argc,char** argv, ctc_ipfix_data_t *data)
{
    uint8 index = 0;

    index = CTC_CLI_GET_ARGC_INDEX("label-num");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("label-num", data->l3_info.mpls.label_num, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls0-label");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("label", data->l3_info.mpls.label[0].label, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls0-s");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("label", data->l3_info.mpls.label[0].sbit, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls0-exp");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("label", data->l3_info.mpls.label[0].exp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls0-ttl");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("label", data->l3_info.mpls.label[0].ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls1-label");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("label", data->l3_info.mpls.label[1].label, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls1-s");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("sbit", data->l3_info.mpls.label[1].sbit, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls1-exp");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("exp", data->l3_info.mpls.label[1].exp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls1-ttl");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ttl", data->l3_info.mpls.label[1].ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls2-label");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("label", data->l3_info.mpls.label[2].label, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls2-s");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("sbit", data->l3_info.mpls.label[2].sbit, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls2-exp");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("exp", data->l3_info.mpls.label[2].exp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mpls2-ttl");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ttl", data->l3_info.mpls.label[2].ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }
    return CLI_SUCCESS;
}
#endif

CTC_CLI(ctc_cli_ipfix_set_hash_field_sel,
         ctc_cli_ipfix_set_hash_field_sel_cmd,
         "ipfix hash-field-sel FIELD_ID" CTC_CLI_IPFIX_HASH_FIELD_KEY_STR"",
         CTC_CLI_IPFIX_M_STR,
         CTC_CLI_FIELD_SEL_ID_DESC,
         CTC_CLI_FIELD_SEL_ID_VALUE,
         CTC_CLI_IPFIX_HASH_FIELD_KEY_STR_DESC)
{
    ctc_ipfix_hash_field_sel_t field;
    uint8 start_index = 0;
    int32 ret = 0;
    uint8 index = 0;

    sal_memset(&field, 0, sizeof(ctc_ipfix_hash_field_sel_t));

    CTC_CLI_GET_UINT8("hash-field-sel",field.field_sel_id, argv[0]);

    start_index = CTC_CLI_GET_ARGC_INDEX("mac-key");
    if (start_index != 0xFF)
    {
        _ctc_cli_ipfix_parser_mac_hash_field_sel(vty,argc, &argv[0],&field.u.mac);
        field.key_type = CTC_IPFIX_KEY_HASH_MAC;
    }
    start_index = CTC_CLI_GET_ARGC_INDEX("ipv4-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            field.key_type = CTC_IPFIX_KEY_HASH_IPV4_SINGLE;
        }
        else
        {
            field.key_type = CTC_IPFIX_KEY_HASH_IPV4;
        }
       _ctc_cli_ipfix_parser_ipv4_hash_field_sel(vty, argc, &argv[0], &field.u.ipv4);

    }
    start_index = CTC_CLI_GET_ARGC_INDEX("ipv6-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            field.key_type = CTC_IPFIX_KEY_HASH_IPV6_SINGLE;
        }
        else
        {
            field.key_type = CTC_IPFIX_KEY_HASH_IPV6;
        }
        _ctc_cli_ipfix_parser_ipv6_hash_field_sel(vty, argc, &argv[0], &field.u.ipv6);
    }
    start_index = CTC_CLI_GET_ARGC_INDEX("mpls-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            field.key_type = CTC_IPFIX_KEY_HASH_MPLS_SINGLE;
        }
        else
        {
            field.key_type = CTC_IPFIX_KEY_HASH_MPLS;
        }
        _ctc_cli_ipfix_parser_mpls_hash_field_sel(vty,argc, &argv[0], &field.u.mpls);
    }
    start_index = CTC_CLI_GET_ARGC_INDEX("l2l3-key");
    if (start_index != 0xFF)
    {
        _ctc_cli_ipfix_parser_l2l3_hash_field_sel(vty, argc, &argv[0], &field.u.l2_l3);
        field.key_type = CTC_IPFIX_KEY_HASH_L2_L3;
    }
    start_index = CTC_CLI_GET_ARGC_INDEX("udf-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            field.key_type = CTC_IPFIX_KEY_HASH_UDF_SINGLE;
        }
        else
        {
            field.key_type = CTC_IPFIX_KEY_HASH_UDF;
        }
        _ctc_cli_ipfix_parser_udf_hash_field_sel(vty,argc, &argv[0], &field.u.udf, 0);
    }
    
    if(g_ctcs_api_en)
    {
        ret = ctcs_ipfix_set_hash_field_sel(g_api_ldev, &field);
    }
    else
    {
        ret = ctc_ipfix_set_hash_field_sel(&field);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    return 0;
}


CTC_CLI(ctc_cli_ipfix_get_hash_field_sel,
         ctc_cli_ipfix_get_hash_field_sel_cmd,
         "show ipfix hash-field-sel FIELD_ID (mac-key | ipv4-key (single|) | ipv6-key (single|) | mpls-key (single|) | l2l3-key | udf-key (single|) )",
         CTC_CLI_SHOW_STR,
         CTC_CLI_IPFIX_M_STR,
         CTC_CLI_FIELD_SEL_ID_DESC,
         CTC_CLI_FIELD_SEL_ID_VALUE,
         "Mac-key",
         "IPv4-key","Single-key",
         "IPv6-key", "Single-key",
         "MPLS-key", "Single-key",
         "L2l3-key",
         "UDF-key","Single-key")
{
    ctc_ipfix_hash_field_sel_t field;
    uint8 start_index = 0;
    int32 ret = 0;
    uint8 index = 0;

    sal_memset(&field, 0, sizeof(ctc_ipfix_hash_field_sel_t));

    CTC_CLI_GET_UINT8("hash-field-sel",field.field_sel_id, argv[0]);

    start_index = CTC_CLI_GET_ARGC_INDEX("mac-key");
    if (start_index != 0xFF)
    {
        field.key_type = CTC_IPFIX_KEY_HASH_MAC;
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("ipv4-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            field.key_type = CTC_IPFIX_KEY_HASH_IPV4_SINGLE;
        }
        else
        {
            field.key_type = CTC_IPFIX_KEY_HASH_IPV4;
        }
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("ipv6-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            field.key_type = CTC_IPFIX_KEY_HASH_IPV6_SINGLE;
        }
        else
        {
            field.key_type = CTC_IPFIX_KEY_HASH_IPV6;
        }
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("mpls-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            field.key_type = CTC_IPFIX_KEY_HASH_MPLS_SINGLE;
        }
        else
        {
            field.key_type = CTC_IPFIX_KEY_HASH_MPLS;
        }
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("l2l3-key");
    if (start_index != 0xFF)
    {
        _ctc_cli_ipfix_parser_l2l3_hash_field_sel(vty, argc, &argv[0], &field.u.l2_l3);
        field.key_type = CTC_IPFIX_KEY_HASH_L2_L3;
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("udf-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            field.key_type = CTC_IPFIX_KEY_HASH_UDF_SINGLE;
        }
        else
        {
            field.key_type = CTC_IPFIX_KEY_HASH_UDF;
        }
    }

    if(g_ctcs_api_en)
    {
        ret = ctcs_ipfix_get_hash_field_sel(g_api_ldev, &field);
    }
    else
    {
        ret = ctc_ipfix_get_hash_field_sel(&field);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("mac-key");
    if (start_index != 0xFF)
    {
        _ctc_cli_ipfix_get_mac_hash_field_sel(vty,argc, &argv[0],&field.u.mac);
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("ipv4-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            _ctc_cli_ipfix_get_ipv4_hash_field_sel(vty,argc, &argv[0],&field.u.ipv4,1);
        }
        else
        {
            _ctc_cli_ipfix_get_ipv4_hash_field_sel(vty,argc, &argv[0],&field.u.ipv4,0);
        }
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("ipv6-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            _ctc_cli_ipfix_get_ipv6_hash_field_sel(vty,argc, &argv[0],&field.u.ipv6,1);
        }
        else
        {
            _ctc_cli_ipfix_get_ipv6_hash_field_sel(vty,argc, &argv[0],&field.u.ipv6,0);
        }
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("mpls-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            _ctc_cli_ipfix_get_mpls_hash_field_sel(vty,argc, &argv[0],&field.u.mpls,1);

        }
        else
        {
            _ctc_cli_ipfix_get_mpls_hash_field_sel(vty,argc, &argv[0],&field.u.mpls,0);
        }
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("l2l3-key");
    if (start_index != 0xFF)
    {
        _ctc_cli_ipfix_get_l2l3_hash_field_sel(vty,argc, &argv[0],&field.u.l2_l3);
    }

    start_index = CTC_CLI_GET_ARGC_INDEX("udf-key");
    if (start_index != 0xFF)
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            _ctc_cli_ipfix_get_udf_hash_field_sel(vty,argc, &argv[0],&field.u.udf,1);
        }
        else
        {
            _ctc_cli_ipfix_get_udf_hash_field_sel(vty,argc, &argv[0],&field.u.udf,0);
        }
    }

    return 0;
}


CTC_CLI(ctc_cli_ipfix_set_global_cfg,
         ctc_cli_ipfix_set_global_cfg_cmd,
         "ipfix global {aging-interval INTERVAL|export-interval INTERVAL|conflict-export VALUE"\
         "|packet-cnt VALUE|bytes-cnt VALUE|time-interval VALUE|sample-mode VALUE|tcp-detect-en VALUE"\
         "|sw-learning VALUE|new-flow-export-en VALUE|unkown-pkt-dest-type VALUE| threshold VALUE"\
         "|latency-type VALUE|clear-conflict-stats|egs-disable VALUE"\
         "|drop-pkt-cnt VALUE|jitter-thrd VALUE|latency-thrd VALUE|jitter-ewma-weight VALUE|latency-ewma-weight VALUE"\
         "|dest-port-type VALUE|ignore-drop-reason VALUE|queue-drop-en VALUE|mirror-pkt-enable VALUE|max-export-entry-num VALUE}",
         CTC_CLI_IPFIX_M_STR,
         "Global config",
         "Aging Interval",
         "Interval time(s)",
         "Export Interval",
         "Export time(ms)",
         "Conflict-export",
         CTC_CLI_BOOL_VAR_STR,
         "Number of packets to be export",
         "Value",
         "Size of bytes to be export",
         "Bytes VALUE",
         "Number of time interval to be export",
         "Time interval VALUE",
         "Sample mode",
         "0-all packets;1-unkown packet",
         "Tcp end detect enable",
         "0-disable, 1-enable",
         "Sw learning",
         "0-disable, 1-enable",
         "New flow export",
         "0-do not export to CPU, 1-export to CPU using DMA",
         "Unkown pkt dest type",
         "0:using group id, 1:using vlan id",
         "Flow usage threshold",
         "Value",
         "Latecny type, 0: latency, 1:jitter",
         "Value",
         "Clear conflict entry counter",
         "Disable egress ipfix",
         "Value",
         "Drop packet count",
         "Value",
         "Jitter thread",
         "Value",
         "Latency thread",
         "Value",
         "Jitter average ewma weight",
         "Value",
         "Latency average ewma weight",
         "Value",
         "Dest port type",
         "Value",
         "Ignore drop reason",
         "Value",
         "Queue drop enable",
         "Value",
         "Mirrored packet do ipfix",
         "Value",
         "Max export entry num to user for call back",
         "Value")
{
    ctc_ipfix_global_cfg_t ipfix_cfg;
    int32 ret = 0;
    uint8 index = 0;
    uint64 byte_cnt = 0;

    sal_memset(&ipfix_cfg, 0, sizeof(ctc_ipfix_global_cfg_t));
    if(g_ctcs_api_en)
    {
        ret = ctcs_ipfix_get_global_cfg(g_api_ldev, &ipfix_cfg);
    }
    else
    {
        ret = ctc_ipfix_get_global_cfg(&ipfix_cfg);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }

    index = CTC_CLI_GET_ARGC_INDEX("aging-interval");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32("aging-interval", ipfix_cfg.aging_interval, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("conflict-export");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("conflict-export", ipfix_cfg.conflict_export, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("packet-cnt");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT32("packet-cnt", ipfix_cfg.pkt_cnt, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("bytes-cnt");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT64("bytes-cnt", byte_cnt, argv[index+1]);
       ipfix_cfg.bytes_cnt = byte_cnt;
    }

    index = CTC_CLI_GET_ARGC_INDEX("time-interval");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT32("time-interval", ipfix_cfg.times_interval, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("sample-mode");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("sample-mode", ipfix_cfg.sample_mode, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("tcp-detect-en");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("tcp-detect-en", ipfix_cfg.tcp_end_detect_en, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("sw-learning");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("sw-learning", ipfix_cfg.sw_learning_en, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("new-flow-export-en");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("new-flow-export-en", ipfix_cfg.new_flow_export_en, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("unkown-pkt-dest-type");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("unkown-pkt-dest-type", ipfix_cfg.unkown_pkt_dest_type, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("threshold");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT32("threshold", ipfix_cfg.threshold, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("latency-type");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("latency type", ipfix_cfg.latency_type, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("clear-conflict-stats");
    if(index != 0xFF)
    {
       ipfix_cfg.conflict_cnt = 0;
    }

    index = CTC_CLI_GET_ARGC_INDEX("export-interval");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32("export-interval", ipfix_cfg.export_interval, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("drop-pkt-cnt");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT16("drop-pkt-cnt", ipfix_cfg.drop_pkt_cnt, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("jitter-thrd");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32("jitter-thrd", ipfix_cfg.jitter_thrd, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("latency-thrd");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT32("latency-thrd", ipfix_cfg.latency_thrd, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("jitter-ewma-weight");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("jitter-ewma-weight", ipfix_cfg.jitter_ewma_weight, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("latency-ewma-weight");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("latency-ewma-weight", ipfix_cfg.latency_ewma_weight, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("egs-disable");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("egs-disable", ipfix_cfg.egs_ipfix_disable, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("dest-port-type");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("dest-port-type", ipfix_cfg.dest_port_type , argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("ignore-drop-reason");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("ignore-drop-reason", ipfix_cfg.ignore_drop_reason, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("queue-drop-en");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("queue-drop-en", ipfix_cfg.queue_drop_en, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("mirror-pkt-enable");
    if(index != 0xFF)
    {
       CTC_CLI_GET_UINT8("mirror-pkt-enable", ipfix_cfg.mirror_pkt_enable, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("max-export-entry-num");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("max-export-entry-num", ipfix_cfg.max_export_entry_num, argv[index + 1]);
    }
    if(g_ctcs_api_en)
    {
        ret = ctcs_ipfix_set_global_cfg(g_api_ldev, &ipfix_cfg);
    }
    else
    {
        ret = ctc_ipfix_set_global_cfg(&ipfix_cfg);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    return 0;
}
CTC_CLI(ctc_cli_ipfix_debug_on,
        ctc_cli_ipfix_debug_on_cmd,
        "debug ipfix (ctc|sys) (debug-level {func|param|info|error|export} |) (log LOG_FILE |)",
        CTC_CLI_DEBUG_STR,
        CTC_CLI_IPFIX_M_STR,
        "CTC layer",
        "Sys layer",
        CTC_CLI_DEBUG_LEVEL_STR,
        CTC_CLI_DEBUG_LEVEL_FUNC,
        CTC_CLI_DEBUG_LEVEL_PARAM,
        CTC_CLI_DEBUG_LEVEL_INFO,
        CTC_CLI_DEBUG_LEVEL_ERROR,
        CTC_CLI_DEBUG_LEVEL_EXPORT,
        CTC_CLI_DEBUG_MODE_LOG,
        CTC_CLI_LOG_FILE)
{

    uint32 typeenum = 0;
    uint8 level = CTC_DEBUG_LEVEL_INFO | CTC_DEBUG_LEVEL_FUNC | CTC_DEBUG_LEVEL_PARAM | CTC_DEBUG_LEVEL_ERROR|CTC_DEBUG_LEVEL_EXPORT;
    uint8 index = 0;
    char file[MAX_FILE_NAME_SIZE];

    index = CTC_CLI_GET_ARGC_INDEX("debug-level");
    if (index != 0xFF)
    {
        level = CTC_DEBUG_LEVEL_NONE;
        index = CTC_CLI_GET_ARGC_INDEX("func");
        if (index != 0xFF)
        {
            level |= CTC_DEBUG_LEVEL_FUNC;
        }

        index = CTC_CLI_GET_ARGC_INDEX("param");
        if (index != 0xFF)
        {
            level |= CTC_DEBUG_LEVEL_PARAM;
        }

        index = CTC_CLI_GET_ARGC_INDEX("info");
        if (index != 0xFF)
        {
            level |= CTC_DEBUG_LEVEL_INFO;
        }

        index = CTC_CLI_GET_ARGC_INDEX("error");
        if (index != 0xFF)
        {
            level |= CTC_DEBUG_LEVEL_ERROR;
        }

        index = CTC_CLI_GET_ARGC_INDEX("export");
        if (index != 0xFF)
        {
            level |= CTC_DEBUG_LEVEL_EXPORT;
        }
    }

    index = CTC_CLI_GET_ARGC_INDEX("log");
    if (index != 0xFF)
    {
        if (sal_strlen(argv[index + 1]) >(MAX_FILE_NAME_SIZE) )
        {
             ctc_cli_out("ERROR: File name is too long!\n\n");
		     return CLI_ERROR;
        }
        sal_strcpy((char*)&file, argv[index + 1]);
        level |= CTC_DEBUG_LEVEL_LOGFILE;
        ctc_debug_set_log_file("ipfix", "ipfix", (void*)&file, 1);
    }

    if (0 == sal_memcmp(argv[0], "ctc", 3))
    {
        typeenum = IPFIX_CTC;
    }
    else
    {
        typeenum = IPFIX_SYS;

    }

    ctc_debug_set_flag("ipfix", "ipfix", typeenum, level, TRUE);
    return CLI_SUCCESS;
}

CTC_CLI(ctc_cli_ipfix_debug_off,
        ctc_cli_ipfix_debug_off_cmd,
        "no debug ipfix (ctc | sys)",
        CTC_CLI_NO_STR,
        CTC_CLI_DEBUG_STR,
        CTC_CLI_IPFIX_M_STR,
        "Ctc layer",
        "Sys layer")
{
    uint32 typeenum = 0;
    uint8 level = 0;

    if (0 == sal_memcmp(argv[0], "ctc", 3))
    {
        typeenum = IPFIX_CTC;
    }
    else if (0 == sal_memcmp(argv[0], "sys", 3))
    {
        typeenum = IPFIX_SYS;
    }

    ctc_debug_set_flag("ipfix", "ipfix", typeenum, level, FALSE);

    return CLI_SUCCESS;
}

CTC_CLI(ctc_cli_ipfix_show_debug,
        ctc_cli_ipfix_show_debug_cmd,
        "show debug ipfix (ctc | sys)",
        CTC_CLI_SHOW_STR,
        CTC_CLI_DEBUG_STR,
        CTC_CLI_IPFIX_M_STR,
        "Ctc layer",
        "Sys layer")
{
    uint32 typeenum = 0;
    uint8 level = 0;
    uint8 en = 0;

    if (0 == sal_memcmp(argv[0], "ctc", 3))
    {
        typeenum = IPFIX_CTC;
    }
    else if (0 == sal_memcmp(argv[0], "sys", 3))
    {
        typeenum = IPFIX_SYS;
    }
    en = ctc_debug_get_flag("ipfix", "ipfix", typeenum, &level) == TRUE;
    ctc_cli_out("Ipfix:%s debug %s level:%s\n", argv[0],
                en ? "on" : "off", ctc_cli_get_debug_desc(level));

    return CLI_SUCCESS;
}


#define __IPFIX_CPU_ADD_OR_DEL_OR_GET_ENTRY__

CTC_CLI(ctc_cli_ipfix_add_or_del_or_get_l2_hashkey,
        ctc_cli_ipfix_add_or_del_or_get_l2_hashkey_cmd,
        "ipfix (add|delete) (flex-key KEY_TYPE origin |)mac-key by key (src-gport SRCPORT|hash-field-sel FIELD_ID){profile-id PROFILE_ID| fid FID_VALUE |"CTC_CLI_IPFIX_KEY_PORT_STR"|"CTC_CLI_IPFIX_KEY_CID_STR"|" CTC_CLI_IPFIX_KEY_L2_STR "|" CTC_CLI_IPFIX_XKEY_STR "|xdata array-field FIELD|resolve-hash-conflict|hash-salt VALUE} (dir DIR)"
        "("CTC_CLI_PP_BMP"|)",
        CTC_CLI_IPFIX_M_STR,
        "Add key by cpu",
        "Delete key by cpu",
        "Flex key",
        "Key type value",
        "Origin",
        "L2 key",
        "By",
        "By Key",
        "Source phyPort",
        CTC_CLI_GPORT_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_VALUE,
        "Config profile id",
        "Profile id",
        "Fid",
        "Fid Value",
        CTC_CLI_KEY_PORT_STR_DESC,
        CTC_CLI_IPFIX_KEY_CID_STR_DESC,
        CTC_CLI_IPFIX_KEY_L2_STR_DESC,
        CTC_CLI_IPFIX_XKEY_STR_DESC,
        "XDATA",
        "(LOCAL) XDATA as KEY-FIELD",
        "[[(LOCAL) XDATA WIDTH ,(LOCAL) XDATA OFFSET ,INVALID ,(LOCAL) XDATA MASK],[...]]",
        "Resolve hash conflict",
        "Hash salt",
        "Hash salt value",
        "Direction",
        "<0:Ingress,1:Egress>",
        CTC_CLI_PP_BMP_STR,
        CTC_CLI_PP_BMP_VALUE)
{
    ctc_ipfix_data_t use_data;
    uint8 index = 0;
    int32 ret = CLI_SUCCESS;
    ctc_field_key_t* p_field = NULL;
    ctc_xdata_field_t xdata_field[35];
    sal_memset(&use_data, 0, sizeof(ctc_ipfix_data_t));
    sal_memset(xdata_field, 0, sizeof(ctc_xdata_field_t)*35);

    index = CTC_CLI_GET_ARGC_INDEX("flex-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("flex-key", use_data.key_type, argv[index+1], 0, CTC_MAX_UINT32_VALUE);
    }
    else
    {
        use_data.key_type = CTC_IPFIX_KEY_HASH_MAC;
    }
    if(use_data.key_type >= CTC_IPFIX_KEY_HASH_FLEX_BASE)
    {
        use_data.flex_key.field_list = mem_malloc(MEM_CLI_MODULE, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        if (NULL == use_data.flex_key.field_list)
        {
            return CLI_ERROR;
        }
        sal_memset(use_data.flex_key.field_list, 0, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        p_field = use_data.flex_key.field_list;
        CTC_CLI_IPFIX_XKEY_FIELD_HASH_SET(p_field, CTC_CLI_IPFIX_KEY_ARG_CHECK(use_data.flex_key.field_num, MAX_XKEY_FIELD_NUM, p_field));
    }

    index = CTC_CLI_GET_ARGC_INDEX("xdata");
    if (0xFF != index)
    {
        use_data.xdata.num = ctc_cmd_get_map_array(1,(void*) (xdata_field),argv[index+2]);
        use_data.xdata.fields = xdata_field;
    }

    index = CTC_CLI_GET_ARGC_INDEX("src-gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("src-gport", use_data.gport, argv[index+1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("hash-field-sel");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("hash-field-sel", use_data.field_sel_id, argv[index+1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("profile-id");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("profile-id", use_data.profile_id, argv[index + 1],0,CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("fid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("fid", use_data.fid, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("gport", use_data.gport, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_GPORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("logic-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("logic-port", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_LOGIC_PORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("metadata");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("metadata", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_METADATA;
    }

    index = CTC_CLI_GET_ARGC_INDEX("src-cid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("src cid", use_data.src_cid, argv[index + 1]);
        use_data.flags |= CTC_IPFIX_DATA_SRC_CID_VALID;
    }
    index = CTC_CLI_GET_ARGC_INDEX("dst-cid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("dst cid", use_data.dst_cid, argv[index + 1]);
        use_data.flags |= CTC_IPFIX_DATA_DST_CID_VALID;
    }

    index = CTC_CLI_GET_ARGC_INDEX("mac-da");
    if (index != 0xFF)
    {
        CTC_CLI_GET_MAC_ADDRESS("mac-da", use_data.dst_mac, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mac-sa");
    if (index != 0xFF)
    {
        CTC_CLI_GET_MAC_ADDRESS("mac-sa", use_data.src_mac, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("eth-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("ether type", use_data.ether_type, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("cvlan");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("cvlan", use_data.cvlan, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_CVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("svlan");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("svlan", use_data.svlan, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_SVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("svlan-prio");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("svlan prio", use_data.svlan_prio, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_SVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("cvlan-prio");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("cvlan prio", use_data.cvlan_prio, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_CVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("svlan-cfi");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("svlan cfi", use_data.svlan_cfi, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_SVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("cvlan-cfi");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("cvlan cfi", use_data.cvlan_cfi, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_CVLAN_TAGGED;
    }
    index = CTC_CLI_GET_ARGC_INDEX("resolve-hash-conflict");
    if (index != 0xFF)
    {
        use_data.flags |= CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT;
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-salt");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("hash salt", use_data.hash_salt, argv[index + 1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("dir");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("dir", use_data.dir, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    CTC_CLI_GET_PP_BMP(index,use_data.pp_bmp);

    index = CTC_CLI_GET_ARGC_INDEX("add");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_add_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_add_entry(&use_data);
        }

    }

    index = CTC_CLI_GET_ARGC_INDEX("delete");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_delete_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_delete_entry(&use_data);
        }
    }

    mem_free(use_data.flex_key.field_list);

    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }

    if (use_data.flags == CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT && use_data.hash_salt != 0)
    {
        ctc_cli_out("%-13s : %u\n", "hash-salt", use_data.hash_salt);
    }
    return CLI_SUCCESS;
}


CTC_CLI(ctc_cli_ipfix_add_or_del_or_get_l2l3_hashkey,
        ctc_cli_ipfix_add_or_del_or_get_l2l3_hashkey_cmd,
        "ipfix (add|delete) (flex-key KEY_TYPE origin |)l2l3-key by key (src-gport SRCPORT|hash-field-sel FIELD_ID)" CTC_CLI_IPFIX_L2_L3_KEY_STR"|"CTC_CLI_IPFIX_KEY_CID_STR "|" CTC_CLI_IPFIX_XKEY_STR "|xdata array-field FIELD|resolve-hash-conflict|hash-salt VALUE}(dir DIR)("CTC_CLI_PP_BMP"|)",
        CTC_CLI_IPFIX_M_STR,
        "Add key by cpu",
        "Delete key by cpu",
        "Flex key",
        "Key type value",
        "Origin",
        "L2L3 key",
        "By",
        "Key",
        "Source phyPort",
        CTC_CLI_GPORT_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_VALUE,
        CTC_CLI_IPFIX_L2_L3_KEY_STR_DESC,
        CTC_CLI_IPFIX_KEY_CID_STR_DESC,
        CTC_CLI_IPFIX_XKEY_STR_DESC,
        "XDATA",
        "(LOCAL) XDATA as KEY-FIELD",
        "[[(LOCAL) XDATA WIDTH ,(LOCAL) XDATA OFFSET ,INVALID ,(LOCAL) XDATA MASK],[...]]",
        "Resolve hash conflict",
        "Hash salt",
        "Hash salt value",
        "Direction",
        "<0:Ingress,1:Egress>",
        CTC_CLI_PP_BMP_STR,
        CTC_CLI_PP_BMP_VALUE   )
{
    ctc_ipfix_data_t use_data;
    uint8 index = 0;
    uint8 mask_len = 0;
    uint32 temp = 0;
    int32 ret = CLI_SUCCESS;
    ctc_field_key_t* p_field = NULL;
    ctc_xdata_field_t xdata_field[35];
    sal_memset(&use_data, 0, sizeof(ctc_ipfix_data_t));
    sal_memset(xdata_field, 0, sizeof(ctc_xdata_field_t)*35);
	
    index = CTC_CLI_GET_ARGC_INDEX("flex-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("flex-key", use_data.key_type, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    else
    {
        use_data.key_type = CTC_IPFIX_KEY_HASH_L2_L3;
    }
    if (use_data.key_type >= CTC_IPFIX_KEY_HASH_FLEX_BASE)
    {
        use_data.flex_key.field_list = mem_malloc(MEM_CLI_MODULE, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        if (NULL == use_data.flex_key.field_list)
        {
            return CLI_ERROR;
        }
        sal_memset(use_data.flex_key.field_list, 0, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        p_field = use_data.flex_key.field_list;
        CTC_CLI_IPFIX_XKEY_FIELD_HASH_SET(p_field, CTC_CLI_IPFIX_KEY_ARG_CHECK(use_data.flex_key.field_num, MAX_XKEY_FIELD_NUM, p_field));
    }

    index = CTC_CLI_GET_ARGC_INDEX("xdata");
    if (0xFF != index)
    {
        use_data.xdata.num = ctc_cmd_get_map_array(1,(void*) (xdata_field),argv[index+2]);
        use_data.xdata.fields = xdata_field;
    }

    index = CTC_CLI_GET_ARGC_INDEX("src-gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("src-gport", use_data.gport, argv[index+1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("hash-field-sel");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("hash-field-sel", use_data.field_sel_id, argv[index+1], 0, CTC_MAX_UINT8_VALUE);        use_data.port_type = CTC_IPFIX_PORT_TYPE_GPORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("profile-id");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("profile-id", use_data.profile_id, argv[index + 1],0,CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("gport", use_data.gport, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_GPORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("logic-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("logic-port", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_LOGIC_PORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("metadata");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("metadata", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_METADATA;
    }
    index = CTC_CLI_GET_ARGC_INDEX("src-cid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("src cid", use_data.src_cid, argv[index + 1]);
        use_data.flags |= CTC_IPFIX_DATA_SRC_CID_VALID;
    }
    index = CTC_CLI_GET_ARGC_INDEX("dst-cid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("dst cid", use_data.dst_cid, argv[index + 1]);
        use_data.flags |= CTC_IPFIX_DATA_DST_CID_VALID;
    }
    index = CTC_CLI_GET_ARGC_INDEX("mac-da");
    if (index != 0xFF)
    {
        CTC_CLI_GET_MAC_ADDRESS("mac-da", use_data.dst_mac, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("mac-sa");
    if (index != 0xFF)
    {
        CTC_CLI_GET_MAC_ADDRESS("mac-sa", use_data.src_mac, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("wlan-radio-id");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("radio-id", use_data.l4_info.wlan.radio_id, argv[index+1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("wlan-radio-mac");
    if (index != 0xFF)
    {
        CTC_CLI_GET_MAC_ADDRESS("radio-mac", use_data.l4_info.wlan.radio_mac, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("wlan-is-ctl-pkt");
    if (index != 0xFF)
    {
        use_data.l4_info.wlan.is_ctl_pkt = 1;
    }


    index = CTC_CLI_GET_ARGC_INDEX("eth-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("ether type", use_data.ether_type, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("svlan");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("svlan", use_data.svlan, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_SVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("svlan-prio");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("svlan piro", use_data.svlan_prio, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_SVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("svlan-cfi");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("svlan cfi", use_data.svlan_cfi, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_SVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("cvlan");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("cvlan", use_data.cvlan, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_CVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("cvlan-prio");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("cvlan prio", use_data.cvlan_prio, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_CVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("cvlan-cfi");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("cvlan cfi", use_data.cvlan_cfi, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.flags |= CTC_IPFIX_DATA_CVLAN_TAGGED;
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-sa");
    if (index != 0xFF)
    {
        CTC_CLI_GET_IPV4_ADDRESS("ipsa", temp, argv[index+1]);
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[index+3],0, CTC_MAX_UINT8_VALUE);
        use_data.l3_info.ipv4.ipsa = temp;
        use_data.l3_info.ipv4.ipsa_masklen = mask_len;
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-da");
    if (index != 0xFF)
    {
        CTC_CLI_GET_IPV4_ADDRESS("ipda", temp, argv[index+1]);
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[index+3],0, CTC_MAX_UINT8_VALUE);
        use_data.l3_info.ipv4.ipda = temp;
        use_data.l3_info.ipv4.ipda_masklen = mask_len;
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-src-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-src", use_data.l4_info.l4_port.source_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-dst-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-dst", use_data.l4_info.l4_port.dest_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("icmp-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("icmp-type", use_data.l4_info.icmp.icmp_type, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("icmp-code");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("icmp-code", use_data.l4_info.icmp.icmpcode, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("igmp-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("igmp-type", use_data.l4_info.igmp.igmp_type, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("tcp-flags");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("tcp-flags", use_data.l4_info.tcp_flags, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("gre-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("gre-key", use_data.l4_info.gre_key, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("vni");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("vni", use_data.l4_info.vni, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ttl");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ttl", use_data.l3_info.ipv4.ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ecn");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ecn", use_data.l3_info.ipv4.ecn, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("vrfid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("vrfid", use_data.l3_info.vrfid, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("fid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("fid", use_data.fid, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("dscp");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("dscp", use_data.l3_info.ipv4.dscp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-sub-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-sub-type", use_data.l4_info.l4_sub_type, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-protocol");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("ip-protocol", use_data.l4_info.type.ip_protocol, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-identification");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("ip-identification", use_data.l3_info.ipv4.ip_identification, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-frag");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("ip-frag", use_data.l3_info.ip_frag, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("aware-tunnel-info-en");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("aware-tunnel-info-en", use_data.l4_info.aware_tunnel_info_en, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("l4-type", use_data.l4_info.type.l4_type, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("arp-op-code");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("arp-op-code", use_data.l3_info.arp.op_code, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("arp-sender-mac");	
    if (index != 0xFF)
    {
        CTC_CLI_GET_MAC_ADDRESS("arp-sender-mac", use_data.l3_info.arp.sender_mac, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("arp-target-mac");
    if (index != 0xFF)
    {
        CTC_CLI_GET_MAC_ADDRESS("arp-target-mac", use_data.l3_info.arp.target_mac, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("arp-sender-ip");
    if (index != 0xFF)
    {
        CTC_CLI_GET_IPV4_ADDRESS("arp-sender-ip", temp, argv[index+1]);
        use_data.l3_info.arp.sender_ip = temp;
    }

    index = CTC_CLI_GET_ARGC_INDEX("arp-target-ip");
    if (index != 0xFF)
    {
        CTC_CLI_GET_IPV4_ADDRESS("arp-target-ip", temp, argv[index+1]);
        use_data.l3_info.arp.target_ip = temp;
    }
    index = CTC_CLI_GET_ARGC_INDEX("resolve-hash-conflict");
    if (index != 0xFF)
    {
        use_data.flags |= CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT;
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-salt");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("hash salt", use_data.hash_salt, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("dir");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("dir", use_data.dir, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    CTC_CLI_GET_PP_BMP(index,use_data.pp_bmp);

    _ctc_cli_ipfix_parser_mpls_key(vty, argc, &argv[0], &use_data);

    index = CTC_CLI_GET_ARGC_INDEX("add");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_add_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_add_entry(&use_data);
        }

    }

    index = CTC_CLI_GET_ARGC_INDEX("delete");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_delete_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_delete_entry(&use_data);
        }
    }

    mem_free(use_data.flex_key.field_list);
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    if (use_data.flags == CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT && use_data.hash_salt != 0)
    {
        ctc_cli_out("%-13s : %u\n", "hash-salt", use_data.hash_salt);
    }

    return CLI_SUCCESS;
}

CTC_CLI(ctc_cli_ipfix_add_or_del_or_get_ipv4_hashkey,
        ctc_cli_ipfix_add_or_del_or_get_ipv4_hashkey_cmd,
        "ipfix (add|delete) (flex-key KEY_TYPE origin |)ipv4-key by key (single|)(src-gport SRCPORT| hash-field-sel FIELD_ID){profile-id PROFILE_ID|"CTC_CLI_IPFIX_KEY_PORT_STR"|"CTC_CLI_IPFIX_KEY_CID_STR"|vrfid VRFID_VALUE | fid FID_VALUE |"CTC_CLI_IPFIX_KEY_L3_STR"|"CTC_CLI_IPFIX_KEY_L4_STR"|"CTC_CLI_IPFIX_KEY_IPV4_L4_STR"|" CTC_CLI_IPFIX_XKEY_STR "|xdata array-field FIELD|resolve-hash-conflict|hash-salt VALUE} (dir DIR)("CTC_CLI_PP_BMP"|)",
        CTC_CLI_IPFIX_M_STR,
        "Add key by cpu",
        "Delete key by cpu",
        "Flex key",
        "Key type value",
        "Origin",
        "Ipv4 key",
        "By",
        "Key",
        "Single ipv4 key",
        "Source phyPort",
        CTC_CLI_GPORT_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_VALUE,
        "Config profile id",
        "Profile id",
        CTC_CLI_KEY_PORT_STR_DESC,
        CTC_CLI_IPFIX_KEY_CID_STR_DESC,
        "Vrfid",
        "Vrfid value",
        "Fid",
        "Fid Value",
        CTC_CLI_IPFIX_KEY_L3_STR_DESC,
        CTC_CLI_IPFIX_KEY_L4_STR_DESC,
        CTC_CLI_IPFIX_KEY_IPV4_L4_STR_DESC,
        CTC_CLI_IPFIX_XKEY_STR_DESC,
        "XDATA",
        "(LOCAL) XDATA as KEY-FIELD",
        "[[(LOCAL) XDATA WIDTH ,(LOCAL) XDATA OFFSET ,INVALID ,(LOCAL) XDATA MASK],[...]]",
        "Resolve hash conflict",
        "Hash salt",
        "Hash salt value",
        "Direction",
        "<0:Ingress,1:Egress>",
        CTC_CLI_PP_BMP_STR,
        CTC_CLI_PP_BMP_VALUE     
        )
{
    ctc_ipfix_data_t use_data;
    uint8 index = 0;
    uint8 mask_len = 0;
    uint32 temp = 0;
    int32 ret = CLI_SUCCESS;
    ctc_field_key_t* p_field = NULL;
    ctc_xdata_field_t xdata_field[35];
    sal_memset(&use_data, 0, sizeof(ctc_ipfix_data_t));
    sal_memset(xdata_field, 0, sizeof(ctc_xdata_field_t)*35);

    index = CTC_CLI_GET_ARGC_INDEX("flex-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("flex-key", use_data.key_type, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    else
    {

        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            use_data.key_type = CTC_IPFIX_KEY_HASH_IPV4_SINGLE;
        }
        else
        {
            use_data.key_type = CTC_IPFIX_KEY_HASH_IPV4;
        }
    }
    if (use_data.key_type >= CTC_IPFIX_KEY_HASH_FLEX_BASE)
    {
        use_data.flex_key.field_list = mem_malloc(MEM_CLI_MODULE, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        if (NULL == use_data.flex_key.field_list)
        {
            return CLI_ERROR;
        }
        sal_memset(use_data.flex_key.field_list, 0, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        p_field = use_data.flex_key.field_list;
        CTC_CLI_IPFIX_XKEY_FIELD_HASH_SET(p_field, CTC_CLI_IPFIX_KEY_ARG_CHECK(use_data.flex_key.field_num, MAX_XKEY_FIELD_NUM, p_field));
    }

    index = CTC_CLI_GET_ARGC_INDEX("xdata");
    if (0xFF != index)
    {
        use_data.xdata.num = ctc_cmd_get_map_array(1,(void*) (xdata_field),argv[index+2]);
        use_data.xdata.fields = xdata_field;
    }

    index = CTC_CLI_GET_ARGC_INDEX("src-gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("src-gport", use_data.gport, argv[index+1], 0, CTC_MAX_UINT32_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-field-sel");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("hash-field-sel", use_data.field_sel_id, argv[index+1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("profile-id");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("profile-id", use_data.profile_id, argv[index + 1],0,CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("gport", use_data.gport, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_GPORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("logic-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("logic-port", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_LOGIC_PORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("metadata");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("metadata", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_METADATA;
    }
    index = CTC_CLI_GET_ARGC_INDEX("src-cid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("src cid", use_data.src_cid, argv[index + 1]);
        use_data.flags |= CTC_IPFIX_DATA_SRC_CID_VALID;
    }
    index = CTC_CLI_GET_ARGC_INDEX("dst-cid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("dst cid", use_data.dst_cid, argv[index + 1]);
        use_data.flags |= CTC_IPFIX_DATA_DST_CID_VALID;
    }
    index = CTC_CLI_GET_ARGC_INDEX("vrfid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("vrfid", use_data.l3_info.vrfid, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("fid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("fid", use_data.fid, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-protocol");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("ip-protocol", use_data.l4_info.type.ip_protocol, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("l4-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-type", use_data.l4_info.type.l4_type, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-sub-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-sub-type", use_data.l4_info.l4_sub_type, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("aware-tunnel-info-en");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("aware-tunnel-info-en", use_data.l4_info.aware_tunnel_info_en, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("dscp");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("dscp", use_data.l3_info.ipv4.dscp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ttl");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ttl", use_data.l3_info.ipv4.ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ecn");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ecn", use_data.l3_info.ipv4.ecn, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("ip-sa");
    if (index != 0xFF)
    {
        CTC_CLI_GET_IPV4_ADDRESS("ipsa", temp, argv[index+1]);
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[index+3],0, CTC_MAX_UINT8_VALUE);
        use_data.l3_info.ipv4.ipsa = temp;
        use_data.l3_info.ipv4.ipsa_masklen = mask_len;
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-da");
    if (index != 0xFF)
    {
        CTC_CLI_GET_IPV4_ADDRESS("ipda", temp, argv[index+1]);
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[index+3],0, CTC_MAX_UINT8_VALUE);
        use_data.l3_info.ipv4.ipda = temp;
        use_data.l3_info.ipv4.ipda_masklen = mask_len;

    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-src-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-src", use_data.l4_info.l4_port.source_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-dst-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-dst", use_data.l4_info.l4_port.dest_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("icmp-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("icmp-type", use_data.l4_info.icmp.icmp_type, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("icmp-code");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("icmp-code", use_data.l4_info.icmp.icmpcode, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("igmp-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("igmp-type", use_data.l4_info.igmp.igmp_type, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("tcp-flags");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("tcp-flags", use_data.l4_info.tcp_flags, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-frag");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("ip-frag", use_data.l3_info.ip_frag, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("ip-identification");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("ip-identification", use_data.l3_info.ipv4.ip_identification, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("ip-pkt-len");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("ip-pkt-len", use_data.l3_info.ipv4.ip_pkt_len, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("gre-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("gre-key", use_data.l4_info.gre_key, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("vni");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("vni", use_data.l4_info.vni, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("resolve-hash-conflict");
    if (index != 0xFF)
    {
        use_data.flags |= CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT;
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-salt");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("hash salt", use_data.hash_salt, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("dir");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("dir", use_data.dir, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    
    CTC_CLI_GET_PP_BMP(index,use_data.pp_bmp);

    index = CTC_CLI_GET_ARGC_INDEX("add");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_add_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_add_entry(&use_data);
        }

    }

    index = CTC_CLI_GET_ARGC_INDEX("delete");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_delete_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_delete_entry(&use_data);
        }
    }

    mem_free(use_data.flex_key.field_list);
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    if (use_data.flags == CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT && use_data.hash_salt != 0)
    {
        ctc_cli_out("%-13s : %u\n", "hash-salt", use_data.hash_salt);
    }
    return CLI_SUCCESS;
}

CTC_CLI(ctc_cli_ipfix_add_or_del_or_get_mpls_hashkey,
        ctc_cli_ipfix_add_or_del_or_get_mpls_hashkey_cmd,
        "ipfix (add|delete) (flex-key KEY_TYPE origin |)mpls-key by key (single|)(src-gport SRCPORT|hash-field-sel FIELD_ID){profile-id PROFILE_ID | fid FID_VALUE |"CTC_CLI_IPFIX_KEY_PORT_STR "|" CTC_CLI_IPFIX_KEY_MPLS_STR "|" CTC_CLI_IPFIX_XKEY_STR "|xdata array-field FIELD|resolve-hash-conflict|hash-salt VALUE}(dir DIR)("CTC_CLI_PP_BMP"|)",
        CTC_CLI_IPFIX_M_STR,
        "Add key by cpu",
        "Delete key by cpu",
        "Flex key",
        "Key type value",
        "Origin",
        "Mpls key",
        "By",
        "Key",
        "Single mpls key",
        "Source phyPort",
        CTC_CLI_GPORT_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_VALUE,
        "Config profile id",
        "Profile id",
        "FID",
        "Fid Value",
        CTC_CLI_KEY_PORT_STR_DESC,
        CTC_CLI_IPFIX_KEY_MPLS_STR_DESC,
        CTC_CLI_IPFIX_XKEY_STR_DESC,
        "XDATA",
        "(LOCAL) XDATA as KEY-FIELD",
        "[[(LOCAL) XDATA WIDTH ,(LOCAL) XDATA OFFSET ,INVALID ,(LOCAL) XDATA MASK],[...]]",
        "Resolve hash conflict",
        "Hash salt",
        "Hash salt value",
        "Direction",
        "<0:Ingress,1:Egress>",
        CTC_CLI_PP_BMP_STR,
        CTC_CLI_PP_BMP_VALUE)
{
    ctc_ipfix_data_t use_data;
    uint8 index = 0;
    int32 ret = CLI_SUCCESS;
    ctc_field_key_t* p_field = NULL;
    ctc_xdata_field_t xdata_field[35];
    sal_memset(&use_data, 0, sizeof(ctc_ipfix_data_t));
    sal_memset(xdata_field, 0, sizeof(ctc_xdata_field_t)*35);

    index = CTC_CLI_GET_ARGC_INDEX("flex-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("flex-key", use_data.key_type, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    else
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            use_data.key_type = CTC_IPFIX_KEY_HASH_MPLS_SINGLE;
        }
        else
        {
            use_data.key_type = CTC_IPFIX_KEY_HASH_MPLS;
        }
    }
    if (use_data.key_type >= CTC_IPFIX_KEY_HASH_FLEX_BASE)
    {
        use_data.flex_key.field_list = mem_malloc(MEM_CLI_MODULE, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        if (NULL == use_data.flex_key.field_list)
        {
            return CLI_ERROR;
        }
        sal_memset(use_data.flex_key.field_list, 0, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        p_field = use_data.flex_key.field_list;
        CTC_CLI_IPFIX_XKEY_FIELD_HASH_SET(p_field, CTC_CLI_IPFIX_KEY_ARG_CHECK(use_data.flex_key.field_num, MAX_XKEY_FIELD_NUM, p_field));
    }

    index = CTC_CLI_GET_ARGC_INDEX("xdata");
    if (0xFF != index)
    {
        use_data.xdata.num = ctc_cmd_get_map_array(1,(void*) (xdata_field),argv[index+2]);
        use_data.xdata.fields = xdata_field;
    }

    index = CTC_CLI_GET_ARGC_INDEX("src-gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("src-gport", use_data.gport, argv[index+1], 0, CTC_MAX_UINT32_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-field-sel");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("hash-field-sel", use_data.field_sel_id, argv[index+1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("profile-id");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("profile-id", use_data.profile_id, argv[index + 1],0,CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("fid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("fid", use_data.fid, argv[index + 1],0,CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("gport", use_data.gport, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_GPORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("logic-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("logic-port", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_LOGIC_PORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("metadata");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("metadata", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_METADATA;
    }

    _ctc_cli_ipfix_parser_mpls_key(vty, argc, &argv[0], &use_data);
    index = CTC_CLI_GET_ARGC_INDEX("resolve-hash-conflict");
    if (index != 0xFF)
    {
        use_data.flags |= CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT;
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-salt");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("hash salt", use_data.hash_salt, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("dir");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("dir", use_data.dir, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    CTC_CLI_GET_PP_BMP(index,use_data.pp_bmp);

    index = CTC_CLI_GET_ARGC_INDEX("add");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_add_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_add_entry(&use_data);
        }

    }

    index = CTC_CLI_GET_ARGC_INDEX("delete");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_delete_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_delete_entry(&use_data);
        }
    }

    mem_free(use_data.flex_key.field_list);

    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    if (use_data.flags == CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT && use_data.hash_salt != 0)
    {
        ctc_cli_out("%-13s : %u\n", "hash-salt", use_data.hash_salt);
    }

    return CLI_SUCCESS;
}

CTC_CLI(ctc_cli_ipfix_add_or_del_or_get_ipv6_hashkey,
        ctc_cli_ipfix_add_or_del_or_get_ipv6_hashkey_cmd,
        "ipfix (add|delete) (flex-key KEY_TYPE origin |)ipv6-key by key (single|)(src-gport SRCPORT|hash-field-sel FIELD_ID){profile-id PROFILE_ID |"CTC_CLI_IPFIX_KEY_PORT_STR"|"CTC_CLI_IPFIX_KEY_CID_STR "| ip-sa X:X::X:X mask-len LEN| ip-da X:X::X:X mask-len LEN|dscp DSCP|flow-label FLOW_LABEL|ttl TTL|ecn ECN|tcp-flags VALUE|ip-frag FRAG|ip-protocol PROTOCOL|wlan-radio-id ID| wlan-radio-mac MAC |wlan-is-ctl-pkt|vrfid VALUE|fid VALUE|" CTC_CLI_IPFIX_KEY_L4_STR "|" CTC_CLI_IPFIX_XKEY_STR "|xdata array-field FIELD|resolve-hash-conflict|hash-salt VALUE} (dir DIR)("CTC_CLI_PP_BMP"||)",
        CTC_CLI_IPFIX_M_STR,
        "Add key by cpu",
        "Delete key by cpu",
        "Flex key",
        "Key type value",
        "Origin",
        "Ipv6 key",
        "By",
        "Key",
        "Single ipv6 key",
        "Source phyPort",
        CTC_CLI_GPORT_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_VALUE,
        "Config profile id",
        "Profile id",
        CTC_CLI_KEY_PORT_STR_DESC,
        CTC_CLI_IPFIX_KEY_CID_STR_DESC,
        "IP-sa",
        CTC_CLI_IPV6_FORMAT,
        "Mask-len",
        "Mask len value<8,12,16,...,128>",
        "IP-da",
        CTC_CLI_IPV6_FORMAT,
        "Mask-len",
        "Mask len value<8,12,16,...,128>",
        "DSCP",
        "DSCP value",
        "Flow label",
        "Flow label value, it will cover l4_port",
        "TTL",
        "TTL Value",
        "Ecn",
        "Ecn value",
        "TCP-flags",
        "Flags value",
        "IP-frag",
        "IP fragement value",
        "IP-protocol",
        "IP protocol value",
        "Radio-id",
        "ID value",
        "Radio mac",
        CTC_CLI_MAC_FORMAT,
        "Is wlan control packet",
        "Vrfid",
        "Vrfid Value",
        "Fid",
        "Fid Value",
        CTC_CLI_IPFIX_KEY_L4_STR_DESC,
        CTC_CLI_IPFIX_XKEY_STR_DESC,
        "XDATA",
        "(LOCAL) XDATA as KEY-FIELD",
        "[[(LOCAL) XDATA WIDTH ,(LOCAL) XDATA OFFSET ,INVALID ,(LOCAL) XDATA MASK],[...]]",
        "Resolve hash conflict",
        "Hash salt",
        "Hash salt value",
        "Direction",
        "<0:Ingress,1:Egress>",
        CTC_CLI_PP_BMP_STR,
        CTC_CLI_PP_BMP_VALUE)
{
    ctc_ipfix_data_t use_data;
    uint8 index = 0;
    uint8 mask_len = 0;
    ipv6_addr_t ipv6_address;
    int32 ret = CLI_SUCCESS;
    ctc_field_key_t* p_field = NULL;
    ctc_xdata_field_t xdata_field[35];
    sal_memset(&use_data, 0, sizeof(ctc_ipfix_data_t));
    sal_memset(xdata_field, 0, sizeof(ctc_xdata_field_t)*35);

    index = CTC_CLI_GET_ARGC_INDEX("flex-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("flex-key", use_data.key_type, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    else
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            use_data.key_type = CTC_IPFIX_KEY_HASH_IPV6_SINGLE;
        }
        else
        {
            use_data.key_type = CTC_IPFIX_KEY_HASH_IPV6;
        }
    }
    if (use_data.key_type >= CTC_IPFIX_KEY_HASH_FLEX_BASE)
    {
        use_data.flex_key.field_list = mem_malloc(MEM_CLI_MODULE, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        if (NULL == use_data.flex_key.field_list)
        {
            return CLI_ERROR;
        }
        sal_memset(use_data.flex_key.field_list, 0, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        p_field = use_data.flex_key.field_list;
        CTC_CLI_IPFIX_XKEY_FIELD_HASH_SET(p_field, CTC_CLI_IPFIX_KEY_ARG_CHECK(use_data.flex_key.field_num, MAX_XKEY_FIELD_NUM, p_field));
    }

    index = CTC_CLI_GET_ARGC_INDEX("xdata");
    if (0xFF != index)
    {
        use_data.xdata.num = ctc_cmd_get_map_array(1,(void*) (xdata_field),argv[index+2]);
        use_data.xdata.fields = xdata_field;
    }

    index = CTC_CLI_GET_ARGC_INDEX("src-gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("src-gport", use_data.gport, argv[index+1], 0, CTC_MAX_UINT32_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-field-sel");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("hash-field-sel", use_data.field_sel_id, argv[index+1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("profile-id");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("profile-id", use_data.profile_id, argv[index + 1],0,CTC_MAX_UINT8_VALUE);
    }
	
    index = CTC_CLI_GET_ARGC_INDEX("gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("gport", use_data.gport, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_GPORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("logic-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("logic-port", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_LOGIC_PORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("metadata");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("metadata", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_METADATA;
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-sa");
    if (index != 0xFF)
    {
        CTC_CLI_GET_IPV6_ADDRESS("ipv6", ipv6_address, argv[index+1]);
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[index+3],0, CTC_MAX_UINT8_VALUE);
        use_data.l3_info.ipv6.ipsa_masklen = mask_len;
        use_data.l3_info.ipv6.ipsa[0] = sal_htonl(ipv6_address[0]);
        use_data.l3_info.ipv6.ipsa[1] = sal_htonl(ipv6_address[1]);
        use_data.l3_info.ipv6.ipsa[2] = sal_htonl(ipv6_address[2]);
        use_data.l3_info.ipv6.ipsa[3] = sal_htonl(ipv6_address[3]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-da");
    if (index != 0xFF)
    {
        CTC_CLI_GET_IPV6_ADDRESS("ipv6", ipv6_address, argv[index+1]);
        CTC_CLI_GET_UINT8_RANGE("mask", mask_len, argv[index+3],0, CTC_MAX_UINT8_VALUE);
        use_data.l3_info.ipv6.ipda_masklen = mask_len;
        use_data.l3_info.ipv6.ipda[0] = sal_htonl(ipv6_address[0]);
        use_data.l3_info.ipv6.ipda[1] = sal_htonl(ipv6_address[1]);
        use_data.l3_info.ipv6.ipda[2] = sal_htonl(ipv6_address[2]);
        use_data.l3_info.ipv6.ipda[3] = sal_htonl(ipv6_address[3]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-type", use_data.l4_info.type.l4_type, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-sub-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-sub-type", use_data.l4_info.l4_sub_type, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("aware-tunnel-info-en");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("aware-tunnel-info-en", use_data.l4_info.aware_tunnel_info_en, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("src-cid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("src cid", use_data.src_cid, argv[index + 1]);
        use_data.flags |= CTC_IPFIX_DATA_SRC_CID_VALID;
    }
    index = CTC_CLI_GET_ARGC_INDEX("dst-cid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("dst cid", use_data.dst_cid, argv[index + 1]);
        use_data.flags |= CTC_IPFIX_DATA_DST_CID_VALID;
    }
    index = CTC_CLI_GET_ARGC_INDEX("l4-src-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-src", use_data.l4_info.l4_port.source_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("l4-dst-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("l4-dst", use_data.l4_info.l4_port.dest_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("icmp-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("icmp-type", use_data.l4_info.icmp.icmp_type, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("icmp-code");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("icmp-code", use_data.l4_info.icmp.icmpcode, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("igmp-type");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("igmp-type", use_data.l4_info.igmp.igmp_type, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("tcp-flags");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("tcp-flags", use_data.l4_info.tcp_flags, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("dscp");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("dscp", use_data.l3_info.ipv6.dscp, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("flow-label");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("flow label", use_data.l3_info.ipv6.flow_label, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ttl");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("ttl", use_data.l3_info.ipv6.ttl, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ecn");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("ecn", use_data.l3_info.ipv6.ecn, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-protocol");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("ip-protocol", use_data.l4_info.type.ip_protocol, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("ip-frag");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("ip-frag", use_data.l3_info.ip_frag, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("tcp-flags");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("tcp-flags", use_data.l4_info.tcp_flags, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("gre-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("gre-key", use_data.l4_info.gre_key, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("vni");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("vni", use_data.l4_info.vni, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("wlan-radio-id");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("radio-id", use_data.l4_info.wlan.radio_id, argv[index+1], 0, CTC_MAX_UINT16_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("wlan-radio-mac");
    if (index != 0xFF)
    {
        CTC_CLI_GET_MAC_ADDRESS("radio-mac", use_data.l4_info.wlan.radio_mac, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("wlan-is-ctl-pkt");
    if (index != 0xFF)
    {
        use_data.l4_info.wlan.is_ctl_pkt = 1;
    }
    
    index = CTC_CLI_GET_ARGC_INDEX("vrfid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("vrfid", use_data.l3_info.vrfid, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("fid");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("fid", use_data.fid, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("resolve-hash-conflict");
    if (index != 0xFF)
    {
        use_data.flags |= CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT;
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-salt");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("hash salt", use_data.hash_salt, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("dir");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("dir", use_data.dir, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    
    CTC_CLI_GET_PP_BMP(index,use_data.pp_bmp);

    index = CTC_CLI_GET_ARGC_INDEX("add");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_add_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_add_entry(&use_data);
        }

    }

    index = CTC_CLI_GET_ARGC_INDEX("delete");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_delete_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_delete_entry(&use_data);
        }
    }

    mem_free(use_data.flex_key.field_list);

    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    if (use_data.flags == CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT && use_data.hash_salt != 0)
    {
        ctc_cli_out("%-13s : %u\n", "hash-salt", use_data.hash_salt);
    }

    return CLI_SUCCESS;
}

CTC_CLI(ctc_cli_ipfix_add_or_del_or_get_udf_hashkey,
        ctc_cli_ipfix_add_or_del_or_get_udf_hashkey_cmd,
        "ipfix (add|delete) (flex-key KEY_TYPE origin |)udf-key by key (single|)(hash-field-sel FIELD_ID){profile-id PROFILE_ID|"CTC_CLI_IPFIX_KEY_PORT_STR "|" CTC_CLI_IPFIX_KEY_UDF_STR "|" CTC_CLI_IPFIX_XKEY_STR "|xdata array-field FIELD|resolve-hash-conflict|hash-salt VALUE}(dir DIR)("CTC_CLI_PP_BMP"|)",
        CTC_CLI_IPFIX_M_STR,
        "Add key by cpu",
        "Delete key by cpu",
        "Flex key",
        "Key type value",
        "Origin",
        "Udf key",
        "By",
        "Key",
        "Single UDF key",
        CTC_CLI_FIELD_SEL_ID_DESC,
        CTC_CLI_FIELD_SEL_ID_VALUE,
        "Config profile id",
        "Profile id",
        CTC_CLI_KEY_PORT_STR_DESC,
        CTC_CLI_IPFIX_KEY_UDF_STR_DESC,
        CTC_CLI_IPFIX_XKEY_STR_DESC,
        "XDATA",
        "(LOCAL) XDATA as KEY-FIELD",
        "[[(LOCAL) XDATA WIDTH ,(LOCAL) XDATA OFFSET ,INVALID ,(LOCAL) XDATA MASK],[...]]",
        "Resolve hash conflict",
        "Hash salt",
        "Hash salt value",
        "Direction",
        "<0:Ingress,1:Egress>",
         CTC_CLI_PP_BMP_STR,
         CTC_CLI_PP_BMP_VALUE   
        )
{
    ctc_ipfix_data_t use_data;
    uint8 index = 0;
    int32 ret = CLI_SUCCESS;
    ctc_field_key_t* p_field = NULL;
    ctc_xdata_field_t xdata_field[35];
    sal_memset(&use_data, 0, sizeof(ctc_ipfix_data_t));
    sal_memset(xdata_field, 0, sizeof(ctc_xdata_field_t)*35);

    index = CTC_CLI_GET_ARGC_INDEX("flex-key");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("flex-key", use_data.key_type, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }
    else
    {
        index = CTC_CLI_GET_ARGC_INDEX("single");
        if (index != 0xFF)
        {
            use_data.key_type = CTC_IPFIX_KEY_HASH_UDF_SINGLE;
        }
        else
        {
            use_data.key_type = CTC_IPFIX_KEY_HASH_UDF;
        }
    }
    if (use_data.key_type >= CTC_IPFIX_KEY_HASH_FLEX_BASE)
    {
        use_data.flex_key.field_list = mem_malloc(MEM_CLI_MODULE, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        if (NULL == use_data.flex_key.field_list)
        {
            return CLI_ERROR;
        }
        sal_memset(use_data.flex_key.field_list, 0, sizeof(ctc_field_key_t)*MAX_XKEY_FIELD_NUM);
        p_field = use_data.flex_key.field_list;
        CTC_CLI_IPFIX_XKEY_FIELD_HASH_SET(p_field, CTC_CLI_IPFIX_KEY_ARG_CHECK(use_data.flex_key.field_num, MAX_XKEY_FIELD_NUM, p_field));
    }

    index = CTC_CLI_GET_ARGC_INDEX("xdata");
    if (0xFF != index)
    {
        use_data.xdata.num = ctc_cmd_get_map_array(1,(void*) (xdata_field),argv[index+2]);
        use_data.xdata.fields = xdata_field;
    }

    index = CTC_CLI_GET_ARGC_INDEX("hash-field-sel");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("hash-field-sel", use_data.field_sel_id, argv[index+1], 0, CTC_MAX_UINT8_VALUE);
    }

    index = CTC_CLI_GET_ARGC_INDEX("profile-id");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT8_RANGE("profile-id", use_data.profile_id, argv[index + 1],0,CTC_MAX_UINT8_VALUE);
    }
    index = CTC_CLI_GET_ARGC_INDEX("gport");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("gport", use_data.gport, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_GPORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("logic-port");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("logic-port", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_LOGIC_PORT;
    }

    index = CTC_CLI_GET_ARGC_INDEX("metadata");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16_RANGE("metadata", use_data.logic_port, argv[index + 1], 0, CTC_MAX_UINT16_VALUE);
        use_data.port_type = CTC_IPFIX_PORT_TYPE_METADATA;
    }

    index = CTC_CLI_GET_ARGC_INDEX("udf-id");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT32("udf-id", use_data.udf_id, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("udf-data");
    if (INDEX_VALID(index))
    {
        uint32 data_num = 0;
        data_num = sal_sscanf(argv[index+1], "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx", \
            (uint8*)use_data.udf,(uint8*)use_data.udf+1,(uint8*)use_data.udf+2,(uint8*)use_data.udf+3,(uint8*)use_data.udf+4,(uint8*)use_data.udf+5,(uint8*)use_data.udf+6,(uint8*)use_data.udf+7,(uint8*)use_data.udf+8,\
            (uint8*)use_data.udf+9,(uint8*)use_data.udf+10,(uint8*)use_data.udf+11,(uint8*)use_data.udf+12,(uint8*)use_data.udf+13,(uint8*)use_data.udf+14,(uint8*)use_data.udf+15);\
        if (data_num<16) {ctc_cli_out("  %%  Get udf data fail! \n");
            return CLI_ERROR;}
    }
    index = CTC_CLI_GET_ARGC_INDEX("resolve-hash-conflict");
    if (index != 0xFF)
    {
        use_data.flags |= CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT;
    }
    index = CTC_CLI_GET_ARGC_INDEX("hash-salt");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT16("hash salt", use_data.hash_salt, argv[index + 1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("dir");
    if (index != 0xFF)
    {
        CTC_CLI_GET_UINT32_RANGE("dir", use_data.dir, argv[index + 1], 0, CTC_MAX_UINT32_VALUE);
    }

    CTC_CLI_GET_PP_BMP(index,use_data.pp_bmp);

    index = CTC_CLI_GET_ARGC_INDEX("add");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_add_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_add_entry(&use_data);
        }

    }

    index = CTC_CLI_GET_ARGC_INDEX("delete");
    if (index != 0xFF)
    {
        if(g_ctcs_api_en)
        {
            ret = ctcs_ipfix_delete_entry(g_api_ldev, &use_data);
        }
        else
        {
            ret = ctc_ipfix_delete_entry(&use_data);
        }
    }

    mem_free(use_data.flex_key.field_list);

    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    if (use_data.flags == CTC_IPFIX_DATA_RESOLVE_HASH_CONFLICT && use_data.hash_salt != 0)
    {
        ctc_cli_out("%-13s : %u\n", "hash-salt", use_data.hash_salt);
    }
    return CLI_SUCCESS;
}

#define ___IPFIX_CPU_ADD_OR_DEL_OR_GET_ENTRY_END__

#if (FEATURE_MODE == 0)


CTC_CLI(ctc_cli_ipfix_set_flow_cfg,
        ctc_cli_ipfix_set_flow_cfg_cmd,
        "ipfix flow-cfg PROFILE_ID (ingress|egress) {sampling-mode VALUE sampling-type TYPE sampling-interval INTERVAL | tcpend-detect-dis VALUE | flow-type TYPE "\
        "|learn-disable VALUE |log-pkt-count VALUE | drop-pkt-mode VALUE | track {burst-event VALUE mode VALUE threshold VALUE |latency-event VALUE mode VALUE threshold VALUE "\
        "|max-latency VALUE mode VALUE |min-latency VALUE mode VALUE |avg-latency VALUE mode VALUE |timstamp VALUE mode VALUE}"\
        "|suppress-reason{"CTC_CLI_IPFIX_EXPORT_REASON_STR"}" \
        "|deny-export-reason{"CTC_CLI_IPFIX_EXPORT_REASON_STR"}" \
        "|drop-reason{"CTC_CLI_IPFIX_DROP_STR"}}("CTC_CLI_PP_BMP"|)",
        CTC_CLI_IPFIX_M_STR,
        "Flow config",
        "Profile id",
        "Ingress",
        "Egress",
        "Sampling mode",
        "0:fixed interval mode ,1:random mode",
        "Sampling type",
        "0:based on all packets, 1: based on unkown packet",
        "Sampling interval(packet cnt)",
        CTC_CLI_UINT32_VAR_STR,
        "TCP End Detect",
        CTC_CLI_BOOL_VAR_STR,
        "Flow type",
        "0-all packet;0x1-non-discard packet;0x2-discard packet;"\
        "0x4-non-burst packet;0x8-burst packet;"\
        "0x10-non-latency packet;0x20-latency packet",
        "Learn disable",
        "Disable learn new flow based port",
        "Log the first N packets for new flow",
        "Log packets count",
        "Drop Pkt Mode",
        "0: drop reason bitmap; 1: export drop packet stats",
        "Alu track",
        "Track burst event type",
        "Track type valid, 0: disable, 1: enable",
        "Mode",
        "Value, 0:16bits width,1:32bits width",
        "Threshold",
        "Count threshold value",
        "Track latency event type",
        "Track type valid, 0: disable, 1: enable",
        "Mode",
        "Value, 0:16bits width,1:32bits width",
        "Threshold",
        "Count threshold value",
        "Track max latency type",
        "Track type valid, 0: disable, 1: enable",
        "Mode",
        "Value, 0:16bits width,1:32bits width",
        "Track minium latency type",
        "Track type valid, 0: disable, 1: enable",
        "Mode",
        "Value, 0:16bits width,1:32bits width",
        "Track average latency type",
        "Track type valid, 0: disable, 1: enable",
        "Mode",
        "Value, 0:16bits width,1:32bits width",
        "Track timestamp type",
        "Track type valid, 0: disable, 1: enable",
        "Mode",
        "Value, 0:16bits width,1:32bits width",
        "Suppress Reason Bmp",
        CTC_CLI_IPFIX_EXPORT_REASON_DESC,
        "Deny Export Report Bmp",
        CTC_CLI_IPFIX_EXPORT_REASON_DESC,
        "Drop reason",
        CTC_CLI_IPFIX_DROP_DESC,
        CTC_CLI_PP_BMP_STR,
        CTC_CLI_PP_BMP_VALUE   )
{
    int32 ret = 0;
    uint8 index = 0;
    ctc_ipfix_flow_cfg_t flow_cfg;
    uint32 tmp_alu_type = 0;

    sal_memset(&flow_cfg, 0, sizeof(flow_cfg));
    
    CTC_CLI_GET_UINT8("flow", flow_cfg.profile_id, argv[0]);

    index = CTC_CLI_GET_ARGC_INDEX("ingress");
    if(index != 0xFF)
    {
        flow_cfg.dir = CTC_INGRESS;
    }
    else
    {
        flow_cfg.dir = CTC_EGRESS;
    }

    if(g_ctcs_api_en)
    {
        ret = ctcs_ipfix_get_flow_cfg(g_api_ldev, &flow_cfg);
    }
    else
    {
        ret = ctc_ipfix_get_flow_cfg(&flow_cfg);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }

    index = CTC_CLI_GET_ARGC_INDEX("tcpend-detect-dis");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("tcpend-detect", flow_cfg.tcp_end_detect_disable, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("learn-disable");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("learn-disable", flow_cfg.learn_disable, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("sampling-mode");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("sampling-mode", flow_cfg.sample_mode, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("sampling-type");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("sampling-type", flow_cfg.sample_type, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("sampling-interval");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT16("sampling-interval", flow_cfg.sample_interval, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("flow-type");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT16("flow-type", flow_cfg.flow_type, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("log-pkt-count");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("log-pkt-count", flow_cfg.log_pkt_count, argv[index+1]);
    }

    index = CTC_CLI_GET_ARGC_INDEX("drop-pkt-mode");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("drop-pkt-mode", flow_cfg.drop_pkt_mode, argv[index+1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("track");
    if (0xFF != index)
    {
        index = CTC_CLI_GET_ARGC_INDEX("burst-event");
        if (0xFF != index)
        {
            flow_cfg.track[tmp_alu_type].type = 0;
            CTC_CLI_GET_UINT8("burst-event", flow_cfg.track[tmp_alu_type].valid, argv[index+1]);
            CTC_CLI_GET_UINT8("mode", flow_cfg.track[tmp_alu_type].count_mode, argv[index+3]);
            CTC_CLI_GET_UINT32("threshold", flow_cfg.track[tmp_alu_type].count_thrd, argv[index+5]);
            tmp_alu_type++;
        }
        index = CTC_CLI_GET_ARGC_INDEX("latency-event");
        if (0xFF != index)
        {
            flow_cfg.track[tmp_alu_type].type = 1;
            CTC_CLI_GET_UINT8("latency-event", flow_cfg.track[tmp_alu_type].valid, argv[index+1]);
            CTC_CLI_GET_UINT8("mode", flow_cfg.track[tmp_alu_type].count_mode, argv[index+3]);
            CTC_CLI_GET_UINT32("threshold", flow_cfg.track[tmp_alu_type].count_thrd, argv[index+5]);
            tmp_alu_type++;
        }

        index = CTC_CLI_GET_ARGC_INDEX("max-latency");
        if (0xFF != index)
        {
            flow_cfg.track[tmp_alu_type].type = 2;
            CTC_CLI_GET_UINT8("max-latency", flow_cfg.track[tmp_alu_type].valid, argv[index+1]);
            CTC_CLI_GET_UINT8("mode", flow_cfg.track[tmp_alu_type].count_mode, argv[index+3]);
            flow_cfg.track[tmp_alu_type].count_thrd = 0;
            tmp_alu_type++;
        }

        index = CTC_CLI_GET_ARGC_INDEX("min-latency");
        if (0xFF != index)
        {
            flow_cfg.track[tmp_alu_type].type = 3;
            CTC_CLI_GET_UINT8("min-latency", flow_cfg.track[tmp_alu_type].valid, argv[index+1]);
            CTC_CLI_GET_UINT8("mode", flow_cfg.track[tmp_alu_type].count_mode, argv[index+3]);
            flow_cfg.track[tmp_alu_type].count_thrd = 0;
            tmp_alu_type++;
        }

        index = CTC_CLI_GET_ARGC_INDEX("avg-latency");
        if (0xFF != index)
        {
            flow_cfg.track[tmp_alu_type].type = 4;
            CTC_CLI_GET_UINT8("avg-latency", flow_cfg.track[tmp_alu_type].valid, argv[index+1]);
            CTC_CLI_GET_UINT8("mode", flow_cfg.track[tmp_alu_type].count_mode, argv[index+3]);
            flow_cfg.track[tmp_alu_type].count_thrd = 0;
            tmp_alu_type++;
        }
        index = CTC_CLI_GET_ARGC_INDEX("timstamp");
        if (0xFF != index)
        {
            flow_cfg.track[tmp_alu_type].type = 5;
            CTC_CLI_GET_UINT8("timstamp", flow_cfg.track[tmp_alu_type].valid, argv[index+1]);
            CTC_CLI_GET_UINT8("mode", flow_cfg.track[tmp_alu_type].count_mode, argv[index+3]);
            flow_cfg.track[tmp_alu_type].count_thrd = 0;
            tmp_alu_type++;
        }
    }
    if(tmp_alu_type)
    {
        sal_memset((flow_cfg.track+tmp_alu_type), 0, sizeof(flow_cfg.track[0])*(CTC_IPFIX_FLOW_TRACK_MAX -tmp_alu_type));
    }

    index = CTC_CLI_GET_ARGC_INDEX("suppress-reason");
    if(index != 0xFF)
    {
        CTC_CLI_IPFIX_SET_SUPPRESS_EXPORT_REASON_BMP;
    }

    index = CTC_CLI_GET_ARGC_INDEX("deny-export-reason");
    if(index != 0xFF)
    {
        CTC_CLI_IPFIX_SET_DENY_EXPORT_REASON_BMP;
    }

    index = CTC_CLI_GET_ARGC_INDEX("drop-reason");
    if(index != 0xFF)
    {
        sal_memset(flow_cfg.drop_report_bmp, 0, sizeof(uint32)*2);
        CTC_CLI_IPFIX_SET_DROP_BMP;
    }

    CTC_CLI_GET_PP_BMP(index,flow_cfg.pp_bmp);

    if(g_ctcs_api_en)
    {
        ret = ctcs_ipfix_set_flow_cfg(g_api_ldev, &flow_cfg);
    }
    else
    {
        ret = ctc_ipfix_set_flow_cfg(&flow_cfg);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }

    return ret;
}

CTC_CLI(ctc_cli_ipfix_show_flow_cfg,
        ctc_cli_ipfix_show_flow_cfg_cmd,
        "show ipfix flow-cfg PROFILE_ID (ingress|egress)",
        CTC_CLI_SHOW_STR,
        CTC_CLI_IPFIX_M_STR,
        "Flow config for ipfix",
        "Profile-id",
        "Ingress",
        "Egress")
{
    int32 ret = 0;
    uint8 index = 0;
    ctc_ipfix_flow_cfg_t ipfix_cfg;
    uint8 pp_id = 0;
    uint32 i=0;
    sal_memset(&ipfix_cfg, 0, sizeof(ctc_ipfix_flow_cfg_t));

    CTC_CLI_GET_UINT8("flow-cfg", ipfix_cfg.profile_id, argv[0]);

    index = CTC_CLI_GET_ARGC_INDEX("ingress");
    if(index != 0xFF)
    {
        ipfix_cfg.dir = CTC_INGRESS;
    }
    else
    {
        ipfix_cfg.dir = CTC_EGRESS;
    }
    CTC_CLI_GET_PP_ID(pp_id);
    ipfix_cfg.pp_bmp = 1<<pp_id;
    
    ctc_cli_out("\n");

    if(g_ctcs_api_en)
    {
         ret = ctcs_ipfix_get_flow_cfg(g_api_ldev,  &ipfix_cfg);
    }
    else
    {
        ret = ctc_ipfix_get_flow_cfg(&ipfix_cfg);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return ret;
    }

    ctc_cli_out("%s\n", (ipfix_cfg.dir)?"Egress Direction Config":"Ingress Direction Config");
    ctc_cli_out("%-25s: %d\n", "Sample Mode", ipfix_cfg.sample_mode);
    ctc_cli_out("%-25s: %d\n", "Sample Type", ipfix_cfg.sample_type);
    ctc_cli_out("%-25s: %d\n", "Sample Pkt Interval", ipfix_cfg.sample_interval);
    ctc_cli_out("%-25s: %s\n", "Tcp End Detect", ipfix_cfg.tcp_end_detect_disable?"Disable":"Enable");
    ctc_cli_out("%-25s: %s\n", "Learn Enable", ipfix_cfg.learn_disable?"Disable":"Enable");
    ctc_cli_out("%-25s: 0x%x\n", "Flow Type", ipfix_cfg.flow_type);
    ctc_cli_out("%-25s: %d\n", "Log-pkt-count", ipfix_cfg.log_pkt_count);

    ctc_cli_out("%-25s: %d\n", "Drop Pkt Mode", ipfix_cfg.drop_pkt_mode);
    ctc_cli_out("%-25s: 0x%08x%08x\n", "drop_report_bmp", ipfix_cfg.drop_report_bmp[1],ipfix_cfg.drop_report_bmp[0]);
    ctc_cli_out("%-25s: 0x%x\n", "Suppress Reason Bmp", ipfix_cfg.suppress_reason_bmp);
    ctc_cli_out("%-25s: 0x%x\n", "Deny Export Reason Bmp", ipfix_cfg.deny_export_reason_bmp);
    

    if (ipfix_cfg.dir == CTC_EGRESS)
    {
        if(ipfix_cfg.track[0].valid)
        {
            ctc_cli_out("\n%-19s%-15s%-15s%-15s\n", "TRACK_TYPE", "TRACK_ENABLE", "TRACK_MODE", "TRACK_THRESHOLD");
            ctc_cli_out("-------------------------------------------------------------\n");
        }
        while(ipfix_cfg.track[i].valid)
        {   
            if(ipfix_cfg.track[i].type == 0)
            {
               ctc_cli_out("%-19s", "Burst Event");
               ctc_cli_out("%-15s", "Enable");
               ctc_cli_out("%-15s", ipfix_cfg.track[i].count_mode?"32bit":"16bit");
               ctc_cli_out("0x%x\n", ipfix_cfg.track[i].count_thrd);
            }
            if(ipfix_cfg.track[i].type == 1)
            {
               ctc_cli_out("%-19s", "Latency Event");
               ctc_cli_out("%-15s", "Enable");
               ctc_cli_out("%-15s", ipfix_cfg.track[i].count_mode?"32bit":"16bit");
               ctc_cli_out("0x%x\n", ipfix_cfg.track[i].count_thrd);
            }
            if(ipfix_cfg.track[i].type == 2)
            {
               ctc_cli_out("%-19s", "Max Latency");
               ctc_cli_out("%-15s", "Enable");
               ctc_cli_out("%-15s", ipfix_cfg.track[i].count_mode?"32bit":"16bit");
               ctc_cli_out("%-15d\n", ipfix_cfg.track[i].count_thrd);
            }
            if(ipfix_cfg.track[i].type == 3)
            {
               ctc_cli_out("%-19s", "Min Latency");
               ctc_cli_out("%-15s", "Enable");
               ctc_cli_out("%-15s", ipfix_cfg.track[i].count_mode?"32bit":"16bit");
               ctc_cli_out("%-15d\n", ipfix_cfg.track[i].count_thrd);
            }
            if(ipfix_cfg.track[i].type == 4)
            {
                ctc_cli_out("%-19s", "Avg Latency");
                ctc_cli_out("%-15s", "Enable");
                ctc_cli_out("%-15s", ipfix_cfg.track[i].count_mode?"32bit":"16bit");
                ctc_cli_out("%-15d\n", ipfix_cfg.track[i].count_thrd);
            }
            if(ipfix_cfg.track[i].type == 5)
            {
               ctc_cli_out("%-19s", "Timestamp");
               ctc_cli_out("%-15s", "Enable");
               ctc_cli_out("%-15s", ipfix_cfg.track[i].count_mode?"32bit":"16bit");
               ctc_cli_out("%-15d\n", ipfix_cfg.track[i].count_thrd);
            }
            i++;
        }
    }

    return CLI_SUCCESS;
}

#endif

CTC_CLI(ctc_cli_ipfix_set_prop,
        ctc_cli_ipfix_set_prop_cmd,
        "ipfix property ( (bulk-operation{(by-prof PROFILE_ID|prof-bmp [PROFILE_BMP])|dump|flush|op-section start-index INDEX entry-num NUM "\
        "|dir DIR}| pro-mburst{mburst-cnt-thrd VALUE mburst-on-thrd VALUE mburst-off-thrd VALUE} | hash-conflict-thrd VALUE"\
        "|low-latency VALUE ))("CTC_CLI_PP_BMP"|)",
        CTC_CLI_IPFIX_M_STR,
        "Set ipfix property",
        "Bulk operation",   
        "Operation by profile id",
        "Profile id",
        "Operation by profile bitmap",
        "Profile bitmap",
        "Enable dump entry",
        "Enable flush entry",
        "Operation in special section",
        "Start index",
        "Index",
        "Entry number",
        "Value",
        "Direction",
        "<0:Ingress,1:Egress>",
        "Pro mburst",
        "Mburst count threshold",
        "Value default:16",
        "Max queue count threshold",
        "Value default:0x3FFFF",
        "Min queue count threshold",
        "Value default:0xFFFF",                  
        "Hash conflict export",
        "0: Hashconflict export disable; 1-8k: Set hashconflict thrd and export enable",
        "Don't wait for ipfix result",
        "Value",
        CTC_CLI_PP_BMP_STR,
        CTC_CLI_PP_BMP_VALUE   )
{
    int32 ret = 0;
    uint8 index = 0;
    ctc_ipfix_property_t ipfix_prop;
    ctc_ipfix_bulk_op_t bulk_op;
    ctc_ipfix_bulk_param_t bulk_param;
    ctc_ipfix_mburst_thrd_t mmu_bstcnt;
    uint32 value = 0;
    uint32 array_size = CTC_CONST8;
    uint32 profile_bmp[8]={0};
    

    sal_memset(&bulk_op, 0, sizeof(bulk_op));
    sal_memset(&ipfix_prop, 0, sizeof(ipfix_prop));
    sal_memset(&bulk_param, 0, sizeof(bulk_param));
    sal_memset(&mmu_bstcnt, 0, sizeof(mmu_bstcnt));

    index = CTC_CLI_GET_ARGC_INDEX("by-prof");
    if (0xFF != index)
    {
        CTC_BIT_SET(bulk_op.flag, CTC_IPFIX_OP_FLAG_BY_PROF);
        CTC_CLI_GET_UINT32("prof id", bulk_op.prof_id, argv[index + 1]);
    }

    /*Note: prof-bmp should be set like this:
    ipfix property bulk-operation op-section start-index 0 entry-num 100 prof-bmp [0x12,0x34,0x56,0x78,0x90,0x87,0x65,0x31]
    */
    index = CTC_CLI_GET_ARGC_INDEX("prof-bmp");
    if (0xFF != index)
    {
        array_size = CTC_CLI_STR_ARRAY_NUM(argv[index + 1]);
        if (array_size > CTC_CONST8)
        {
            ctc_cli_out("elements of array input is larger than max size\n");
            return CLI_ERROR;
        }
        CTC_BIT_SET(bulk_op.flag, CTC_IPFIX_OP_FLAG_BY_PROF);

        CTC_CLI_GET_UINT32_ARRAY("prof-bmp", profile_bmp, &array_size, argv[index + 1], ret);
        if (ret < 0)
        {
            ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
            return CLI_ERROR;
        }
        sal_memcpy(bulk_op.prof_id_bmp,profile_bmp,sizeof(profile_bmp));
    }

    index = CTC_CLI_GET_ARGC_INDEX("dump");
    if (0xFF != index)
    {
        CTC_BIT_SET(bulk_op.flag, CTC_IPFIX_OP_FLAG_DUMP_EN);
    }
    index = CTC_CLI_GET_ARGC_INDEX("flush");
    if (0xFF != index)
    {
        CTC_BIT_SET(bulk_op.flag, CTC_IPFIX_OP_FLAG_FLUSH_EN);
    }
    index = CTC_CLI_GET_ARGC_INDEX("dir");
    if (0xFF != index)
    {
        CTC_CLI_GET_UINT8("direction", bulk_param.dir, argv[index + 1]);
    }
    index = CTC_CLI_GET_ARGC_INDEX("op-section");
    if (0xFF != index)
    {
        index = CTC_CLI_GET_ARGC_INDEX("start-index");
        if (0xFF != index)
        {
            CTC_CLI_GET_UINT32("start-index", bulk_param.start_index, argv[index + 1]);
        }
        index = CTC_CLI_GET_ARGC_INDEX("entry-num");
        if (0xFF != index)
        {
            CTC_CLI_GET_UINT16("entry-num", bulk_param.entry_num, argv[index + 1]);
        }
    }
    index = CTC_CLI_GET_ARGC_INDEX("bulk-operation");
    if (0xFF != index)
    {
        ipfix_prop.type = CTC_IPFIX_PROP_BULK_OP;
        ipfix_prop.value  = &bulk_op;
        bulk_op.p_param = &bulk_param;
    }
    index = CTC_CLI_GET_ARGC_INDEX("pro-mburst");
    if (0xFF != index)
    {
        ipfix_prop.type = CTC_IPFIX_PROP_MBURST;
        ipfix_prop.value  = &mmu_bstcnt;
    }
        
    index = CTC_CLI_GET_ARGC_INDEX("hash-conflict-thrd");
    if (0xFF != index)
    {
        CTC_CLI_GET_UINT32("hash-conflict-thrd", value, argv[index + 1]);
        ipfix_prop.type = CTC_IPFIX_PROP_HASH_CONFLICT_THRD;
        ipfix_prop.value  = &value;
    }

    index = CTC_CLI_GET_ARGC_INDEX("low-latency");
    if (0xFF != index)
    {
        CTC_CLI_GET_UINT32("low-latency", value, argv[index + 1]);
        ipfix_prop.type = CTC_IPFIX_PROP_LOW_LATENCY;
        ipfix_prop.value  = &value;
    }

    index = CTC_CLI_GET_ARGC_INDEX("mburst-cnt-thrd");
    if(index != 0xFF)
    {
        CTC_CLI_GET_UINT8("mburst-cnt-thrd", mmu_bstcnt.mburst_cnt_thrd, argv[index + 1]);
        CTC_CLI_GET_UINT32("mburst-on-thrd", mmu_bstcnt.mburst_on_thrd, argv[index + 3]);
        CTC_CLI_GET_UINT32("mburst-off-thrd", mmu_bstcnt.mburst_off_thrd, argv[index + 5]);
    }

    CTC_CLI_GET_PP_BMP(index,ipfix_prop.pp_bmp);

    if(g_ctcs_api_en)
    {
        ret = ctcs_ipfix_set_property(g_api_ldev, &ipfix_prop);
    }
    else
    {
        ret = ctc_ipfix_set_property(&ipfix_prop);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% ret = %d, %s \n", ret, ctc_get_error_desc(ret));
        return CLI_ERROR;
    }
    return ret;
}

CTC_CLI(ctc_cli_ipfix_show_prop,
        ctc_cli_ipfix_show_prop_cmd,
        "show ipfix property (bulk-operation |bulk-miss| pro-mburst |hash-conflict-thrd"\
        "|low-latency)((dir DIR)|)",
        CTC_CLI_SHOW_STR,
        CTC_CLI_IPFIX_M_STR,
        "Show ipfix property",
        "Bulk operation",
        "Bulk miss status",
        "Pro mburst",        
        "Hash conflict threshold",
        "Low latency",
        "Direction",
        "<0:Ingress,1:Egress>")
{
    int32 ret = 0;
    uint8 index = 0;
    uint8 i = 0;
    uint32 value=0;
    uint8 pp_id = 0;
    ctc_ipfix_property_t ipfix_prop;
    ctc_ipfix_bulk_op_t bulk_op;
    ctc_ipfix_bulk_op_miss_t bulk_op_miss;
    ctc_ipfix_bulk_param_t  p_param;
    ctc_ipfix_mburst_thrd_t mmu_bstcnt;

    sal_memset(&ipfix_prop, 0, sizeof(ipfix_prop));
    sal_memset(&bulk_op, 0, sizeof(bulk_op));
    sal_memset(&bulk_op_miss, 0, sizeof(bulk_op_miss));
    sal_memset(&p_param, 0, sizeof(ctc_ipfix_bulk_param_t));
    sal_memset(&mmu_bstcnt, 0, sizeof(mmu_bstcnt));
    ipfix_prop.value = &value;

    index = CTC_CLI_GET_ARGC_INDEX("bulk-operation");
    if (0xFF != index)
    {
        ipfix_prop.type = CTC_IPFIX_PROP_BULK_OP;
        bulk_op.p_param=&p_param;
        ipfix_prop.value = &bulk_op;
        index = CTC_CLI_GET_ARGC_INDEX("dir");
        if (index != 0xFF)
        {
            CTC_CLI_GET_UINT8_RANGE("dir", p_param.dir, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
        }
    }
    index = CTC_CLI_GET_ARGC_INDEX("bulk-miss");
    if (0xFF != index)
    {
        ipfix_prop.type = CTC_IPFIX_PROP_BULK_MISS;
        ipfix_prop.value = &bulk_op_miss;
        index = CTC_CLI_GET_ARGC_INDEX("dir");
        if (index != 0xFF)
        {
            CTC_CLI_GET_UINT8_RANGE("dir", bulk_op_miss.dir, argv[index + 1], 0, CTC_MAX_UINT8_VALUE);
        }
    }
    index = CTC_CLI_GET_ARGC_INDEX("pro-mburst");
    if (0xFF != index)
    {
        ipfix_prop.type = CTC_IPFIX_PROP_MBURST;
        ipfix_prop.value = &mmu_bstcnt;
    }

    index = CTC_CLI_GET_ARGC_INDEX("hash-conflict-thrd");
    if (0xFF != index)
    {
        ipfix_prop.type = CTC_IPFIX_PROP_HASH_CONFLICT_THRD;
    }
    
    index = CTC_CLI_GET_ARGC_INDEX("low-latency");
    if (0xFF != index)
    {
        ipfix_prop.type = CTC_IPFIX_PROP_LOW_LATENCY;
    }
    
    CTC_CLI_GET_PP_ID(pp_id);
    ipfix_prop.pp_bmp = 1<<pp_id;
    if(g_ctcs_api_en)
    {
        ret = ctcs_ipfix_get_property(g_api_ldev, &ipfix_prop);
    }
    else
    {
        ret = ctc_ipfix_get_property(&ipfix_prop);
    }
    if (ret < 0)
    {
        ctc_cli_out("%% %s \n\r", ctc_get_error_desc(ret));
        return CLI_ERROR;
    }

    ctc_cli_out("-----------------------Detail Of Ipfix Property Information-------------------\r\n");
    if (CTC_IPFIX_PROP_BULK_OP == ipfix_prop.type)
    {
        if(CTC_IS_BIT_SET(bulk_op.flag, CTC_IPFIX_OP_FLAG_BY_PROF))
        {
            ctc_cli_out("%-30s:%-6u \n", "by profile id", bulk_op.prof_id);
            ctc_cli_out("%-30s:[", "by profile bitmap");
            for (i = 0; i < 7; i++)
            {
                ctc_cli_out("0x%x,", bulk_op.prof_id_bmp[i]);
            }
            ctc_cli_out("0x%x]\n", bulk_op.prof_id_bmp[i]);
        }
        if(CTC_IS_BIT_SET(bulk_op.flag, CTC_IPFIX_OP_FLAG_DUMP_EN))
        {
            ctc_cli_out("%-30s \n", "enable dump");
        }
        if(CTC_IS_BIT_SET(bulk_op.flag, CTC_IPFIX_OP_FLAG_FLUSH_EN))
        {
            ctc_cli_out("%-30s \n", "enable flush");
        }
        if(bulk_op.p_param->start_index)
        {
            ctc_cli_out("%-30s:0x%x \n", "stopping traverse index when DMA full", bulk_op.p_param->start_index);   
        }
    }
    else if (CTC_IPFIX_PROP_BULK_MISS == ipfix_prop.type)
    {
        ctc_cli_out("%-30s:%-6u \n", "miss count by dump", bulk_op_miss.miss_cnt);
        ctc_cli_out("%-30s:%-6u \n", "one round done", bulk_op_miss.one_round_done);
    }
    else if (CTC_IPFIX_PROP_MBURST == ipfix_prop.type)
    {
        ctc_cli_out("%-30s:0x%x \n", "mburst-cnt-thrd", mmu_bstcnt.mburst_cnt_thrd);
        ctc_cli_out("%-30s:0x%x \n", "mburst-on-thrd", mmu_bstcnt.mburst_on_thrd);
        ctc_cli_out("%-30s:0x%x \n", "mburst-off-thrd", mmu_bstcnt.mburst_off_thrd);
    }
    else if (CTC_IPFIX_PROP_HASH_CONFLICT_THRD == ipfix_prop.type)
    {
        ctc_cli_out("%-30s:%-6u \n", "hash-conflict-thrd", *(uint32*)(ipfix_prop.value));
    }
    else if (CTC_IPFIX_PROP_LOW_LATENCY == ipfix_prop.type)
    {
        ctc_cli_out("%-30s:%-6u \n", "low-latency", *(uint32*)(ipfix_prop.value));
    }

    return CLI_SUCCESS;
}

int32
ctc_ipfix_cli_init(void)
{
#if (FEATURE_MODE == 0)
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_set_flow_cfg_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_show_flow_cfg_cmd);
#endif

    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_set_hash_field_sel_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_get_hash_field_sel_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_set_global_cfg_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_show_debug_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_debug_off_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_debug_on_cmd);

    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_add_or_del_or_get_l2_hashkey_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_add_or_del_or_get_l2l3_hashkey_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_add_or_del_or_get_ipv4_hashkey_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_add_or_del_or_get_mpls_hashkey_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_add_or_del_or_get_ipv6_hashkey_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_add_or_del_or_get_udf_hashkey_cmd);

    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_set_prop_cmd);
    install_element(CTC_SDK_MODE, &ctc_cli_ipfix_show_prop_cmd);
    return CLI_SUCCESS;

}
#endif

